You get more reliable tracking when your tag manager reacts to explicit events from your application, rather than scraping the DOM at unpredictable times. The Adobe Client Data Layer (ACDL) gives you a standard place to publish those events.
In this build you initialise adobeDataLayer, push a page event and a click (interaction) event, then wire Adobe Launch rules to those events. You finish with checks you can run in the browser console and via network requests, so you can confirm the implementation works end to end.
You must check the exact names of Launch UI fields and the ACDL event listener API in the official documentation, because Adobe’s UI labels and extension capabilities can vary by organisation setup and enabled extensions.
Before you start
- Access to Adobe Experience Platform Data Collection (Data Collection UI) for your organisation
- Permission to create or edit a Data Collection property (Launch property) and publish to an environment
- A website or web app where you can add JavaScript and, if needed, a tag snippet (library embed code)
- Basic familiarity with browser Developer Tools (Console and Network tabs)
- A basic understanding of events, page view vs interaction tracking and JSON objects
Step 1: Define your event and data naming conventions
Write down a small schema you will keep stable across the site: event names, required fields and where values come from. You do this first to avoid brittle rules in Launch that depend on ad hoc field names.
Use a small set of events, for example pageView and interaction. Use predictable payload keys such as page.name, page.type, user.state, interaction.name and interaction.component.
// Convention example (document this for your team):
// - event: "pageView" | "interaction"
// - page: { name, type, language }
// - user: { state }
// - interaction: { name, component }
// - xdm or analytics keys: only if you need them and can keep them stableStep 2: Add the Adobe Client Data Layer bootstrap before Launch
Add the ACDL bootstrap snippet as early as you can in the document head, before the Launch embed code. You do this so events pushed during early page load are not lost and so Launch can subscribe to the data layer.
If you already have an application-level bootstrap file, place this snippet there, but ensure it runs before any tracking pushes.
// Place this before the Launch embed code.
// This creates a queueing array and preserves it if it already exists.
window.adobeDataLayer = window.adobeDataLayer || [];Step 3: Embed the Launch library after the data layer bootstrap
Install the Launch (Data Collection) embed code on your site after the ACDL bootstrap. You do this so Launch can attach listeners and process any queued items.
Copy the embed code from the Data Collection UI for the environment you are targeting. The exact menu path and snippet content can vary, so confirm it in the official Adobe Experience Platform Data Collection documentation.
// Paste your Launch embed code here, directly after the ACDL bootstrap.
// The exact snippet is environment-specific, so do not hand-edit it.
// Example placeholder:
// <script src="https://assets.adobedtm.com/.../launch-ENVID.min.js" async></script>Step 4: Create a single helper to push events into ACDL
Create one small function that pushes events in a consistent shape. You do this to reduce duplication and keep the implementation easy to audit.
Keep the helper dependency-free so it can run anywhere, including in server-rendered templates.
// Put this in a file loaded on every page, after the ACDL bootstrap.
(function () {
window.trackToDataLayer = function trackToDataLayer(eventName, payload) {
if (!window.adobeDataLayer || !Array.isArray(window.adobeDataLayer)) {
// Fail safe, do not throw in production pages.
return;
}
window.adobeDataLayer.push({
event: eventName,
eventInfo: payload || {},
timestamp: new Date().toISOString()
});
};
})();Step 5: Push a page view event when the page context is known
Push a pageView event when you can reliably populate the page context. You do this so Launch rules can fire off an explicit signal rather than guessing when the DOM is ready.
On traditional multi-page sites this can be immediately after rendering. On single-page apps, push it on each route change with the new page context.
// Example: call this once per page load (or per SPA route change).
trackToDataLayer("pageView", {
page: {
name: document.title,
type: "content", // Replace with your taxonomy.
language: document.documentElement.lang || ""
},
user: {
state: "anonymous" // Replace with your known state.
}
});Step 6: Push an interaction event on user actions you care about
Bind to a concrete UI action and push an interaction event with a stable name and component identifier. You do this so Launch can trigger a rule per interaction type without brittle selectors.
Prefer event delegation on a container where practical, so your code survives UI re-rendering.
// Example: track clicks on elements with a data-track attribute.
document.addEventListener("click", function (e) {
var el = e.target && e.target.closest ? e.target.closest("[data-track]") : null;
if (!el) return;
var name = el.getAttribute("data-track") || "";
var component = el.getAttribute("data-component") || "";
trackToDataLayer("interaction", {
interaction: {
name: name,
component: component
}
});
});Step 7: Verify ACDL receives events in the browser console
Open Developer Tools and confirm that adobeDataLayer exists and contains pushed objects. You do this before touching Launch rules, so you know the source of truth is correct.
If you see an empty array after interacting with the page, your push code is not running or is running in a different frame.
// Run in the browser console:
window.adobeDataLayer;
// Optional: inspect the last few items.
window.adobeDataLayer.slice(-5);Step 8: Add the Adobe Client Data Layer extension in Launch
In your Data Collection property, add the Adobe Client Data Layer extension. You do this because Launch typically needs an extension to subscribe to ACDL events and to map event payload into rule context.
The extension name and configuration UI should be visible under Extensions in the Data Collection UI. If you cannot find it, check the official Data Collection documentation and your organisation’s extension availability.
Step 9: Create a Launch rule that listens for the page view event
Create a rule whose event trigger is an ACDL event with name pageView. You do this to ensure your page tracking runs exactly when the application declares the page context.
In the rule, add an action that produces an observable outcome you can test, such as logging to the console. The exact action type depends on what extensions you have installed, so check the Launch rule action options in the official documentation rather than guessing field names.
// If you have a "Custom Code" action available in Launch, use code like this.
// Exact availability and UI naming must be verified in Adobe Launch documentation.
console.log("Launch rule fired: pageView", event);Step 10: Create a Launch rule that listens for the interaction event
Create a second rule whose event trigger is an ACDL event with name interaction. You do this so interaction tracking is decoupled from DOM timing and can be managed centrally.
Filter inside the rule (or via rule conditions) by eventInfo.interaction.name or eventInfo.interaction.component, depending on what your extension exposes to the rule context. The exact variable path you can reference in Launch depends on the extension’s data mapping, so confirm in the Adobe Client Data Layer extension documentation.
// Example "Custom Code" action for debugging.
console.log("Launch rule fired: interaction", event);Step 11: Publish your Launch changes to a testable environment
Create or update a library and build it to your chosen environment (Development or Staging) in the Data Collection UI. You do this because rule changes do not affect your site until they are built and published.
Confirm that your site is loading the embed code for the same environment you published to, otherwise you will test the wrong build.
Step 12: Run an end-to-end check by triggering events and observing results
Load the site with your published Launch build, trigger a page view and an interaction, then confirm that your Launch debug actions run. You do this to validate the full path: application event, ACDL queue, Launch listener, rule execution.
If you used console logging actions, you should see your messages in the Console. If you wired actions to a vendor tag (for example Adobe Analytics or Adobe Experience Platform Web SDK), confirm the network requests in the Network tab instead.
// In the console, manually trigger an interaction to validate wiring:
trackToDataLayer("interaction", {
interaction: { name: "test-interaction", component: "debug" }
});Step 13: Harden the implementation for production
Standardise payload fields and add lightweight guards so production pages do not throw errors if tracking code loads out of order. You do this to reduce broken tracking from edge cases like partial renders, consent gating or third-party script delays.
If you operate consent management, push a dedicated consent or privacy event into ACDL and have Launch rules respect it. The correct approach depends on your consent tooling and Adobe setup, so check the relevant Adobe documentation for consent integration rather than inventing a pattern.
// Optional: a safe wrapper that avoids pushing empty interaction names.
window.safeTrackInteraction = function safeTrackInteraction(name, component) {
if (!name) return;
trackToDataLayer("interaction", {
interaction: {
name: String(name),
component: component ? String(component) : ""
}
});
};What you should see
You can verify the implementation by checking all of the following:
1) window.adobeDataLayer exists and contains objects with event: "pageView" and event: "interaction" after you navigate and click.
2) Launch rules configured to listen for those ACDL event names execute when the corresponding pushes occur.
3) Your chosen observable outcome happens, for example console messages from rule actions and or expected network requests from configured tags.
Troubleshooting
- No events appear in
window.adobeDataLayerafter navigation or clicks – Your push code is not running, is running before the bootstrap, or the interaction selector does not match the clicked elements. Fix: Confirm the ACDL bootstrap runs before any push calls. Add a temporaryconsole.logbeforeadobeDataLayer.push. Verify elements have the expecteddata-trackattributes and thatclosestis supported in your target browsers. - Events appear in
adobeDataLayerbut Launch rules do not fire – The Launch build on the page is not the environment you published, the ACDL extension is not installed or configured, or the rule event is listening for a different event name. Fix: Confirm the embed code matches the environment you built to. Ensure the Adobe Client Data Layer extension is installed and enabled in the property. Double-check the exact event name string used in the rule trigger, including case. - Launch rules fire intermittently on single-page apps – The app is not pushing a
pageViewevent on route changes, or pushes happen before Launch subscribes. Fix: PushpageViewon every route change with updated context. Ensure the ACDL bootstrap is before Launch, then push events after your app has computed route state. If you must push early, rely on the queueing behaviour and confirm the extension processes queued items, per its documentation. - The rule context does not expose the expected
eventInfofields – The ACDL extension maps data differently than you assumed, or you are using the wrong data element type in Launch. Fix: Check the Adobe Client Data Layer extension documentation for how event payload is exposed to rules and data elements. Inspect what your debug action receives, for example by logging theeventobject in a Custom Code action.
Glossary
- ACDL (Adobe Client Data Layer) – A standard JavaScript data layer format used to publish events and state from your site or app for consumption by Adobe tooling such as Launch.
- Launch – Adobe’s tag management capabilit within Adobe Experience Platform Data Collection, used to deploy and manage client-side rules and extensions.
- Data Collection property – A container in the Adobe Data Collection UI that holds extensions, data elements, rules and publishing libraries for a site or app.
- Rule – A set of triggers, conditions and actions in Launch that runs when an event occurs.
- Event payload – The structured data sent with an event, used to provide context such as page metadata or interaction details.
Frequently asked questions
Do you need ACDL to implement Launch?
No, but using ACDL gives Launch a reliable event stream and consistent context. Without it you often end up relying on DOM selectors and timing assumptions that break when the UI changes.
Should you push state objects or only events?
Push events with the context needed to act on them, and keep state updates deliberate and documented. The exact ACDL patterns for state versus events should be confirmed in the Adobe Client Data Layer documentation, because implementations vary.
Where should you map ACDL data to analytics fields?
Do the minimum mapping needed in Launch to route data into the target tag, and keep business logic in your application. Follow the official documentation for the specific Adobe product you are sending data to, because field mappings and best practices differ.
How do you handle SPAs?
Instrument route changes in the app and push a pageView event with the new route context each time. Avoid relying on initial page load triggers for SPA navigation.
How do you confirm Launch is firing without adding vendor tags?
Add a temporary Launch rule action that logs to the console when an ACDL event fires. Remove or disable the debug action before production promotion.
Next steps
- Replace debug console actions with real tag actions for your Adobe products, following the relevant official documentation.
- Define a versioned data layer contract and add automated checks in your app build to prevent accidental breaking changes.
- Extend the event model with commerce or form events if required, keeping the number of event types small.
- Add monitoring that alerts when expected events or network calls drop unexpectedly, using your organisation’s observability tooling.

Conversation