Sign inGet started
Tracking

Events from Google's dataLayer

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

The tag reads the events your site already pushes for Google Tag Manager, such as purchases and sign-ups.

Updated

If your site uses Google Tag Manager or gtag.js, it already pushes events to window.dataLayer. The tag reads them too, so your purchases, sign-ups and leads arrive without a new line of code. The work you did for Google counts twice.

Which events does the tag read?

Both shapes work: Google Tag Manager's objects and gtag's commands.

dataLayer.push({ event: "purchase", ecommerce: { transaction_id: "A-10492", value: 129.9, currency: "EUR", items: [/* … */] } });
gtag("event", "sign_up", { method: "Google" });
EventBecomes
purchaseAn order, with its transaction_id, value and currency
Any other event (sign_up, generate_lead, add_to_cart…)A custom event of that name, with how many items, the sign-in method, value and currency

What does the tag leave out?

  • page_view and Google's own events (gtm.js, gtm.click…): the tag counts page views itself.
  • Everything else in the push: user_data, emails, phones, addresses and other parameters never leave the page.
  • More than 100 events from one page load.
Related
  • What the tag collects: Page views, clicks, forms, scroll, errors and page speed, counted without code. What never leaves the page.
  • Add the tag: Put one script line in the head of every page. Where it goes in plain HTML, site builders and each framework.
  • Cookieless counting and consent: The tag counts without cookies until a visitor agrees. How consent works, from your banner or your code.
  • Custom events: Send your own events and orders, such as sign-ups, demo requests and purchases, with one line of JavaScript each, so revenue ties to the visit.
  • Identify people: Name signed-in people with identify, so their visits on every device make one profile your agent can read. It works only after the visitor's consent.
  • Subdomains, domains and Safari: Keep one visitor across your subdomains and your other domains, and stop Safari from forgetting returning visitors after 7 days.
Still have questions?
Was this page useful?