Skip to content

Document consent-aware Focus Item embedding (split Focus scripts) - #914

Draft
promptless-for-oss wants to merge 2 commits into
mautic:7.2from
Promptless:promptless/pr-16926-focus-consent-embedding
Draft

Document consent-aware Focus Item embedding (split Focus scripts)#914
promptless-for-oss wants to merge 2 commits into
mautic:7.2from
Promptless:promptless/pr-16926-focus-consent-embedding

Conversation

@promptless-for-oss

@promptless-for-oss promptless-for-oss commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Open in Promptless

Documents the consent-aware Focus Item embedding introduced by mautic/mautic PR #16926, which splits the Focus Item embed JavaScript so a site can display a Focus Item before tracking consent and activate tracking only after consent (GDPR).

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.

In the "Deploying to a website" section of docs/channels/focus_items.rst, this describes the renamed 'Focus implementation' panel, which offers two options for external websites — 'Consent-managed' (a display script plus a tracking activation snippet that calls the public window.MauticFocus.enableTracking(<id>) API) and 'Full tracking' (a single snippet that activates tracking immediately) — plus copyable Landing Page tokens. It states plainly that Mautic doesn't record or verify consent; it only separates displaying the Focus Item from activating tracking.

It also documents the global 'Use Mautic consent for Focus tracking' setting (off by default, under the 'Script modifiers' heading on the Tracking Settings tab) that bridges Mautic website-tracking consent to Focus tracking — including the scope limit (Consent-managed embeds only) and a warning that, without consent-managed website tracking, Focus tracking activates with no consent gating. The {focus=ID|display} / {focus=ID|tracking} page-builder token variants are documented, and supporting cross-references were added/updated in configuration/settings.rst, configuration/variables.rst, configuration/tracking_script.rst, and components/dynamic_web_content.rst. A new docs/links/mautic_focus_item_scripts_docs.py xref link points to the developer documentation.

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 is window.MauticFocus.enableTracking(<id>).

Targets the 7.2 docs branch (source base 7.x).

Document the split Focus Item scripts from mautic/mautic PR #16926: the
Consent-managed vs Full tracking install options and the
enableMauticFocusTracking{id}() activation callback, the global
'Use Mautic consent for Focus tracking' setting, and the
{focus=ID|display}/{focus=ID|tracking} token variants. Also refresh the
now-stale Focus note in the tracking script page.
@patrykgruszka

Copy link
Copy Markdown
Member

@promptless-for-oss the source PR was updated, re-check and update the docs.

@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Thanks @patrykgruszka — picking this up now. We're re-checking the updated source PR (mautic/mautic#16926) and refreshing this documentation to match the current endpoints, tokens, and consent setting. We'll follow up on this thread once the updated changes are ready.

Update the split-Focus-scripts documentation to match the now-ready state
of mautic/mautic PR #16926 (source head ebe9fdfb):

- Foreground the public window.MauticFocus.enableTracking(<id>) activation
  API and remove the no-longer-existent enableMauticFocusTracking{id}()
  callback.
- Rename the panel to 'Focus implementation' and describe the two external-
  website options ('Consent-managed' / 'Full tracking') plus Landing Page
  tokens without over-specifying UI chrome.
- Clarify the 'Use Mautic consent for Focus tracking' setting ('Script
  modifiers' heading, default off, scope, and the no-consent-gating failure
  mode), and add a runnable activation example, an :xref: to the developer
  docs, and clearer actor guidance.
@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

Update: we've refreshed this documentation to match the current source PR. Highlights: the install panel is now described as 'Focus implementation' with the two external-website options ('Consent-managed' and 'Full tracking'), the public activation API is documented as window.MauticFocus.enableTracking(<id>) (the earlier draft-era enableMauticFocusTracking{id}() callback no longer exists in the ready PR and was removed), and the 'Use Mautic consent for Focus tracking' setting is clarified (default off, scope noted, with a consent-gating warning). Citations were re-anchored to the current source. Ready for another look.

@promptless-for-oss

Copy link
Copy Markdown
Contributor Author

@patrykgruszka done — we've re-checked this documentation against the updated source PR and pushed the corrected changes.

The key fix: the activation API is now documented as the public window.MauticFocus.enableTracking(<id>) call, since the earlier per-item enableMauticFocusTracking{id}() callback no longer exists in the current implementation. We also:

  • Renamed the panel to 'Focus implementation' and described the two external-website options ('Consent-managed' / 'Full tracking') plus the Landing Page tokens.
  • Clarified the 'Use Mautic consent for Focus tracking' setting (default off, under 'Script modifiers', with a note on the no-consent-gating case).
  • Aligned the Dynamic Web Content injection behavior and added a runnable activation example plus a cross-reference to the developer docs.
  • Re-anchored all citations to the current source.

One heads-up: the embed screenshot on this page still shows the old single-script panel and predates the 'Focus implementation' rename — let us know if you'd like it refreshed before merge. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants