feat(nx2): Omega Adobe Launch + GTM injected at end of body#444
Open
anfibiacreativa wants to merge 5 commits into
Open
feat(nx2): Omega Adobe Launch + GTM injected at end of body#444anfibiacreativa wants to merge 5 commits into
anfibiacreativa wants to merge 5 commits into
Conversation
Append the stage Launch bootstrap URL after page load for non-prod hosts and branch previews, with an opt-in for production via meta omega-tracking. Google Tag Manager loads when meta gtm-id contains a valid GTM- container id. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow Launch/GTM injection on prod-like hosts when the URL has nx=ew or nx=ew-omega-* (any branch matching that prefix), or when meta omega-tracking is set to on. Also adds PR-throwaways/ to .gitignore. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
scripts.js only runs for AEM content pages via head.html; the canvas route on da.live never loads it. Move the call into loadArea (nx.js) which is the universal entry point for all page types. Co-authored-by: Cursor <cursoragent@cursor.com>
Replaces the blanket `env !== 'prod'` check that fired on every aem.page preview with an explicit host+path gate: only da.live (or localhost) on /canvas and /browse, gated by nx=ew or nx=ew-omega-* query param (or omega-tracking meta override). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts.js), append the Adobe Launch stage bootstrap and (when configured) Google Tag Manager to the end ofdocument.body, not to<head>, so Omega can test whether tracking still loads correctly with a deferred / bottom-of-page injection.*.da.live, localhost) authoring pages.Why
What Changed
nx2/utils/omega-tracking.js:initOmegaTracking()gates onenv(fromnx.js): runs on non-prodhosts; onprodonly if<meta name="omega-tracking" content="on">is present.scriptnodes usedocument.body.append(...)afterloadPage()— nothing from this module is inserted intodocument.head.<meta name="gtm-id" content="GTM-…">must be set (strictGTM-[A-Z0-9]+); there is no hardcoded container id in repo. Same file buildsgtm.jsURL and appends the hiddennoscriptiframe to the body end.exc-unifiedcontent.experience-stage.adobe.net/.../launch-3e9e0f669557-development.min.js.nx2/scripts/scripts.jscallsinitOmegaTracking()immediately afterawait loadPage().Test Plan
scripttags for Launch (and GTM if meta set) are last children ofbody, not underhead.eworew-omega-*gtm-idmeta to a test container; confirmgtm.jsanddataLayer.https://ew-omega-launch--da-nx--adobe.aem.page/