Tags, Tag Management, and Data Layer Design
The data layer is the contract between page and tag manager
A well-designed data layer is a versioned, documented JavaScript object that the page populates before tag management rules fire. It decouples the site's rendering code from analytics logic: marketers change tags, not page code. Design it as a flat or lightly nested schema with stable, semantic keys (page.type, user.loginState, cart.value), typed values, and a clear event/state model. Use an event-driven pattern where the page pushes a named event plus its payload, and tag rules listen for that event rather than polling the DOM.
Concepts you must know
Understand Adobe Experience Platform Tags building blocks: properties, extensions (Adobe Experience Platform Web SDK, Analytics, Core), data elements, rules (event, condition, action), and publishing flow (development, staging, production libraries). Know data element types: JavaScript variable, CSS selector, cookie, and custom code. Know rule ordering, rule-level and action-level conditions, and the difference between library-loaded and DOM-ready triggers. Recognize the risk of data elements resolved at rule-fire time versus at action-execution time, and the need for a "data layer ready" trigger.
Traps in questions
- Building analytics from CSS selectors and DOM scraping; brittle and discouraged when a data layer exists.
- Firing tags on page load before the data layer is populated, producing undefined values.
- Using global custom code instead of scoped data elements, creating unmaintainable dependencies.
- Assuming publishing to production is instant; libraries must be built and approved.
- Hardcoding IDs in custom code rather than using data elements.
Worked example
A checkout confirmation page pushes {event:'checkout_complete', order:{id, revenue, currency}}. Create a data element DL - order revenue reading that path, a rule triggered on the custom event, and an action setting purchase with revenue from the data element. QA by checking the beacon in the debugger before publishing.