> Part of the walkerOS documentation. Project overview and full index: <https://www.walkeros.io/llms.txt>

# walkerOS tagging vs. dataLayer.push

Google's `dataLayer` has been the standard way to push data to Google Tag Manager. But it requires manual work for every event. Here's how walkerOS tagging compares.

## Quick comparison[​](#quick-comparison "Direct link to Quick comparison")

| Feature                | dataLayer.push          | walkerOS tagging                  |
| ---------------------- | ----------------------- | --------------------------------- |
| Tagging approach       | Manual JavaScript calls | HTML attributes (data-elb)        |
| Event state management | Manual updates required | Automatic, real-time              |
| Consent handling       | Manual setup in GTM     | Built-in                          |
| Version control        | Hard to track changes   | In your codebase                  |
| Component reusability  | Copy-paste code         | Tag once, use everywhere          |
| Metadata enrichment    | Manual                  | Automatic (timing, session, etc.) |

## Who should use what?[​](#who-should-use-what "Direct link to Who should use what?")

### Keep using dataLayer.push if[​](#keep-using-datalayerpush-if "Direct link to Keep using dataLayer.push if")

* You have an existing GTM setup you don't want to change
* Your tracking is minimal and rarely changes
* Your team prefers JavaScript over HTML attributes

### Switch to walkerOS tagging if[​](#switch-to-walkeros-tagging-if "Direct link to Switch to walkerOS tagging if")

* You want tracking integrated into your components
* You're tired of manual event management
* You need automatic consent handling
* You want version-controlled, reviewable tracking
* You're building with modern component frameworks

## Key differences[​](#key-differences "Direct link to Key differences")

### How tagging works[​](#how-tagging-works "Direct link to How tagging works")

**dataLayer.push:** You write JavaScript to collect values, build the event object, and push it at the right time. Every event needs manual code.

```
dataLayer.push({

  event: 'add_to_cart',

  ecommerce: {

    items: [

      { item_id: 'sku123', item_name: 'Cool Hat', price: 29.99, quantity: 1 },

    ],

  },

});
```

You must gather all values yourself and ensure the push happens after DOM ready and consent is granted.

**walkerOS tagging:** You add HTML attributes to your components. walkerOS reads the DOM, detects interactions, checks consent, and pushes events automatically.

Code

HTMLCSSJS

Loading...

Preview

GlobalsContextEntityPropertyAction

Events

Loading...

Mapping

Loading...

Result

Loading...

Tag the button once. walkerOS handles listening for clicks, collecting data from attributes, checking consent, and pushing to any destination.

### Component integration[​](#component-integration "Direct link to Component integration")

**dataLayer.push:** Tracking is often hard-coded separately from components, or managed entirely in GTM. New features frequently launch without tracking because it's an afterthought.

**walkerOS tagging:** Tracking lives in your HTML alongside your components. When you build a component, you tag it once. It works everywhere that component appears: different pages, different contexts, same tracking.

### Maintenance[​](#maintenance "Direct link to Maintenance")

**dataLayer.push:** Every event needs individual updates. Change a product schema? Update every push call. Add a new field? Touch every file.

**walkerOS tagging:** Global attributes apply everywhere automatically. Component-level tagging means one change updates all instances. Event metadata (timing, session, consent state) is added automatically.

## Can they work together?[​](#can-they-work-together "Direct link to Can they work together?")

Yes! You can use the [GTM destination](https://www.walkeros.io/docs/destinations/web/gtag/gtm.md) to send walkerOS events into the dataLayer for your existing GTM tags. This lets you adopt walkerOS tagging while keeping your current GTM setup working.

## Getting started[​](#getting-started "Direct link to Getting started")

Ready to try walkerOS tagging? Check out the [tagging guide](https://www.walkeros.io/docs/sources/web/browser/tagging/html-attributes.md) to see how HTML attributes replace manual push calls.
