MTAM
Tba.
Datalayer
MTAM watches . The top-level field routes , , and operations. Include an label to make each push easy to inspect; the agent does not use that label for routing. The track event name is in .
The routing fields are top-level. Identify traits are read from the top level; track properties are supplied as a JSON object in .
Identify
window.dataLayer.push({
event: "homepageProfileUpdated",
eventType: "identify",
userId: window.mtam.sso.userId,
firstname: window.mtam.sso.firstname,
lastname: window.mtam.sso.lastname,
relationship: "friend",
harness: window.mtam.sso.harness
});The CDP agent sends . must be truthy. The four listed traits are read from the top level; other fields are not forwarded. An exact repeat of the last identified and traits is suppressed.
This example sets explicitly to demonstrate a changed trait. A manual dataLayer push tests the event path only: it does not update or save a Preferences change.
Page
window.dataLayer.push({
event: "homepagePage",
eventType: "page",
pageName: document.title,
pagePath: window.location.pathname,
pageUrl: window.location.href
});The CDP agent sends . is the pathname; is the full URL, including any query string or fragment. If is empty or absent, is used as the page name.
Track
Hosted Apps report events through the Homepage bridge. Homepage validates the source iframe, origin, App slug, and exact instance before adding this dataLayer record; Apps do not call the CDP SDK directly.
window.dataLayer.push({
event: "homepageAppTrack",
eventType: "track",
trackEventName: "Generated Image",
appSlug: "image-generator",
properties: {}
});is assigned by Homepage and forwarded as a trusted track property; Apps cannot override it. Event names are limited to 100 characters and must be a JSON object no larger than 16 KiB when serialized. The active agent sends with after the initial profile ; tracks are queued while its SDK loads.
Homepage-owned tracks use and omit . For example, the Preferences-use event has this shape:
window.dataLayer.push({
event: "homepagePreferencesUsed",
eventType: "track",
trackSource: "homepage",
trackEventName: "Use Preferences",
properties: {}
});Homepage starts measuring only when the user opens Preferences by clicking the Homepage logo. It emits this event once during that opening after at least 3 seconds of foreground-visible time and a deliberate interaction with a control in the drawer. URL-driven and other programmatic openings do not qualify. Preference values are not included in .
Keep event properties safe for CDP delivery. Do not include credentials, secrets, generated image bytes, private prompts, or other sensitive request data.