Add Focus Item scripts developer page (split Focus scripts) - #614
Add Focus Item scripts developer page (split Focus scripts)#614promptless-for-oss wants to merge 2 commits into
Conversation
Document the split Focus Item embed scripts from mautic/mautic PR #16926:
the /focus/{id}/display.js and /focus/{id}/tracking.js endpoints (legacy
/focus/{id}.js preserved), the RUNTIME/DISPLAY/TRACKING scope model, and the
client-side runtime globals (MauticFocusItems, MauticFocusTrackingQueue,
MauticFocusUseMauticTrackingConsent), the enableMauticFocusTracking{id}()
callback, and the mautic:tracking-enabled event. Add a matching event bullet
and toctree entry.
|
@promptless-for-oss the source PR was updated, re-check and update the docs. |
|
Thanks @patrykgruszka — on it. We're re-checking the updated source PR (mautic/mautic#16926) and refreshing this developer page to match the current endpoints, runtime globals, and activation API. We'll follow up on this thread once the updated changes are ready. |
Update the developer docs for the split Focus scripts to match the now-ready
state of mautic/mautic PR #16926 (source head ebe9fdfb):
- Foreground the public window.MauticFocus.enableTracking(<id>) API and remove
the no-longer-existent generated enableMauticFocusTracking{id}() callback.
- Distinguish the Focus scope enum (FocusJsScope) from BuildJsScope, noting they
share no code path and gate different script families.
- Clarify that Dynamic Web Content injects the legacy /focus/{id}.js additively
on top of the always-allowed display.js once tracking is enabled.
- Add a runnable registry/queue inspection example and tighten the
mautic:tracking-enabled cross-reference.
|
Update: we've refreshed this developer page to match the current source PR. Highlights: the public activation API is now documented as |
|
@patrykgruszka done — we've re-checked this developer page against the updated source PR and pushed the corrected changes. The key fix: the activation API is now documented as the public
The PR is updated and ready for another look. Since PR #16926 isn't merged yet, we'll reconcile again if further code changes land before merge. |
Open in Promptless
Adds a new developer page
docs/mauticjs_api/focus_scripts.rstdocumenting the consent-aware split of Focus Item embed scripts introduced by mautic/mautic PR #16926, mirroring the existing "Script scopes and split scripts" model on the tracking-script page.Updated to match the now-ready source PR (head
ebe9fdfb). This suggestion was first drafted against an earlier draft of the source PR; it has been reconciled to the current implementation.The page documents:
RUNTIME/DISPLAY/TRACKINGscope model (a Focus-specificFocusJsScopeenum, distinct fromBuildJsScope— the two share no code path and gate different script families)./focus/{id}/display.js(display, no tracking),/focus/{id}/tracking.js(tracking layer), and the preserved legacy/focus/{id}.jsaggregate — all sendingCache-Control: private, no-store.window.MauticFocus.enableTracking(<id>), plus the supporting globalswindow.MauticFocusItems,window.MauticFocusTrackingQueue, andwindow.MauticFocusUseMauticTrackingConsent, and themautic:tracking-enableddocument event./focus/{id}/display.jsis always injected; the legacy/focus/{id}.jsis injected additionally (not instead) only whenMauticJS.trackingEnabledistrue.A matching
mautic:tracking-enabledbullet was added to the tracking-script page and the new page registered in the MauticJS API toctree.Reconciliation note: the earlier draft described a generated per-item
enableMauticFocusTracking{id}()callback; that named callback does not exist in the ready source. The documented public entry point iswindow.MauticFocus.enableTracking(<id>), which the copied 'Consent-managed' snippet calls inline (with awindow.MauticFocusTrackingQueuefallback).Targets the 7.2 docs branch (source base 7.x).