Say your agency spent a month building a Tag Manager container for a client’s site. Every form, every checkout step and every purchase pushes a neatly named event into the dataLayer. Now the client wants to try a cookieless analytics tool alongside GA4, and track their Google Tag Manager dataLayer events in both.
The usual worry is that someone has to tag the whole site again. With FunnelSights, nobody does.
This post shows how to track Google Tag Manager dataLayer events without re-tagging: how the capture works, which pushes count, which are skipped, and how GA4 ecommerce values turn into revenue. By the end you’ll be able to look at any push on your site and predict what FunnelSights records.
Key takeaways
- The FunnelSights tracker reads window.dataLayer, so events pushed by GTM tags and gtag calls arrive under the names you already use.
- Pushes made before the script loads are replayed, so purchases written into thank-you pages aren’t missed.
- GTM’s own gtm.* messages, page_view, pushes without an event name and non-event gtag commands are all ignored.
- Simple parameters become properties, and value with currency (top-level or in a GA4 ecommerce object) becomes revenue.
- Any captured event carrying value and currency adds to revenue, so check your layer for events that duplicate a sale or value a lead.
What is the dataLayer?
The dataLayer is a JavaScript array on your page, called window.dataLayer, that Google Tag Manager reads. Your site or a tag adds messages to it with dataLayer.push(), and GTM decides which tags to fire based on them.
gtag.js, the script behind GA4’s own snippet, uses the same array. Every gtag('event', …) call pushes its arguments into window.dataLayer.
So on a site tagged for GA4, the dataLayer is already a running log of the things someone decided were worth measuring. That’s what FunnelSights reads.
How FunnelSights tracks Google Tag Manager dataLayer events
When the FunnelSights script loads, it does two things with the dataLayer.
First, it reads everything already in the array and processes it. Then it wraps the array’s push method, so every later push passes through it as well as through GTM.
- PushYour site, a GTM tag or a gtag() call adds a message to window.dataLayer.
- ReadThe tracker sees it, whether it was pushed before or after the script loaded.
- FilterMessages without an event name, GTM’s own gtm.* messages and page_view are dropped here.
- MapSimple parameters become properties. Value and currency become revenue, and an ecommerce transaction_id becomes a property.
- SendThe event goes to ingest under the name you pushed and shows up in Goals & Events.
The tracker adds one request, to the FunnelSights ingest endpoint. Your GTM tags keep firing exactly as before.
Pushes before the script loads are replayed
Imagine a thank-you page that writes its purchase straight into the HTML: a dataLayer.push near the top of the page, before any scripts run. The FunnelSights tag loads with defer, so it arrives after that push.
That’s fine. Because the tracker reads the array’s existing contents when it loads, the purchase is replayed and recorded. A conversion written into a thank-you page isn’t missed.
Load order doesn’t matter
GTM also wraps the push method. FunnelSights wraps it rather than replacing it, and each wrapper calls through to the one before. So it works whether GTM or FunnelSights loads first.
Which dataLayer pushes are captured?
Here’s how common pushes are recorded, from a plain sign-up to a GA4 purchase.
| Push | Recorded as |
|---|---|
| dataLayer.push({ event: 'sign_up', method: 'google' }) | Event sign_up, with the property method = google |
| gtag('event', 'generate_lead', { form_id: 'contact' }) | Event generate_lead, with the property form_id = contact |
| dataLayer.push({ event: 'purchase', ecommerce: { value: 19.5, currency: 'EUR', transaction_id: 'T2', items: [...] } }) | Event purchase, 19.50 EUR of revenue, property transaction_id = T2. The items array is dropped. |
| gtag('event', 'purchase', { value: '49.00', currency: 'USD', transaction_id: 'T3' }) | Event purchase, 49 USD of revenue. value, currency and transaction_id are kept as properties too. |
| GTM’s own messages: gtm.js, gtm.dom, gtm.load, gtm.click | Skipped |
| gtag('event', 'page_view') | Skipped, because the tracker records pageviews itself |
| dataLayer.push({ ecommerce: null }) | Ignored, because there’s no event name |
| gtag('config', 'G-XXXXXXX') or gtag('consent', 'update', …) | Ignored, because these are commands, not events |
Two patterns cover the whole table. A push counts if it has an event key holding a name (the GTM style) or if it’s a gtag('event', name, params) call. After that, anything named page_view or starting with gtm. is skipped.
That second rule matters more than it looks. GTM’s built-in triggers produce messages like gtm.click, gtm.linkClick and gtm.formSubmit. Those are Tag Manager’s internal plumbing, so they’re skipped, while custom events you named yourself come through.
You don’t lose anything there. FunnelSights records outbound clicks, downloads and form submits on its own, as covered in tracking clicks, downloads and forms without code.
Which parameters become properties?
Only simple values are kept: strings, numbers and true or false. Objects and arrays are dropped, so GA4’s ecommerce object and its items array never become properties. Keys starting with gtm., such as gtm.uniqueEventId, are dropped as well.
The usual property limits then apply. An event keeps up to 30 properties, everything is stored as text, and breakdowns show the 100 most common values of each property per day.
Here’s the catch to look for. Every simple parameter on a captured event becomes a property, including ones you never meant to share with analytics. If a push includes user_email or a customer ID, it will be stored.
Check your layer for parameters like that before you rely on it. Event properties are fields you control, and the privacy protections of FunnelSights’ defaults don’t cover what you put in them.
How value and currency become revenue
FunnelSights follows GA4’s own definition. It looks for value and currency at the top level of the event first, as a gtag() call sends them.
If they’re not there, it looks inside the ecommerce object. That’s the shape most store integrations push through GTM, WooCommerce plugins included. A few rules apply:
- value can be a number or a numeric string, so '49.00' works. NaN and Infinity never count.
- currency must be a three-letter code. Without it, the event is still recorded, just without revenue.
- An ecommerce transaction_id is copied to a property, unless the push already has one at the top level.
dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'T-1042',
value: 72.5,
currency: 'GBP',
items: [{ item_id: 'SKU-1', price: 72.5, quantity: 1 }]
}
})That push is recorded as a purchase event with 72.50 GBP of revenue and a transaction_id property of T-1042. If the thank-you page is reloaded within 24 hours, ingest sees the same transaction ID on the same event and drops the repeat.
The guide to revenue tracking for websites covers what happens with several currencies, and how analytics revenue lines up with your order system.
What to check on a site that’s already tagged
Because capture is automatic, whatever your container pushes shows up. That’s mostly good news, but four patterns deserve a look in your first week.
A sale that’s pushed twice
Revenue adds up across every captured event that carries value and currency. Say the thank-you page fires a GA4 purchase and a separate ad-platform conversion event, both carrying the order value. Your revenue total counts that sale twice.
Goals & Events shows revenue by event name, so this is easy to spot. Take the value off one of the two events, or switch dataLayer capture off and send the purchase yourself.
A lead with a value
GA4 lets you put a value on events like generate_lead. FunnelSights treats any value with a currency as revenue, so a lead valued at 50 EUR adds 50 EUR to your revenue.
Decide whether you want lead value in your revenue figure. If not, the change belongs in your tags, because the capture has no per-event switch.
Two routes for the same action
If a developer has added funnelsights('Signup') and the container also pushes sign_up, every sign-up arrives twice, under two names. Pick one route and remove the other.
A renamed dataLayer
GTM’s snippet lets you rename the data layer. FunnelSights reads only the default window.dataLayer, so pushes to a renamed layer aren’t captured.
How to switch dataLayer capture off
If your layer is noisy and you’d rather send events yourself, add one attribute to the script tag:
<script defer data-domain="example.com" data-datalayer="false" src="https://backend.funnelsights.com/js/script.js?d=example.com"></script>
Most sites are better off leaving it on. Noisy events cost some scrolling and some event volume, but you only nominate the ones that matter as goals. The rest sit quietly in the list.
Should you load FunnelSights through GTM?
You can. A Custom HTML tag firing on all pages works, but the tag then waits for GTM to load before it starts. Pasting it straight into the head of your pages measures more visits.
Either way, the dataLayer replay means events pushed before the tracker arrives still count. The getting-started guide shows where the tag goes.
Running FunnelSights next to GA4
Because the same pushes feed both tools, you can run them side by side and compare event counts directly. Expect some difference, since the tools count visitors differently and filter different traffic. Running GA4 and cookieless analytics side by side explains what to compare.
When you’re ready to move, your GA4 event names come with you, so your conversions can be rebuilt as goals on the same names. Migrating GA4 conversions and goals covers that step, and the event tracking guide shows where dataLayer capture fits beside the other ways to send events. For the product side, see integrations.
Frequently asked questions
Do I need to change my GTM container to use FunnelSights?
No. The tracker reads window.dataLayer directly, so events your tags and gtag calls already push are recorded under the same names. You add one script tag and leave the container alone.
Are events pushed before the tracker loads captured?
Yes. When the script loads, it reads everything already in the dataLayer and records it, then catches every later push. A purchase written into a thank-you page before the tracker loads is still counted.
Why don’t I see gtm.click or page_view events?
They are skipped on purpose. Messages starting with gtm. are Tag Manager’s own plumbing, and page_view would double count pageviews the tracker already records. Custom events you named yourself come through.
Does GA4 ecommerce revenue come through?
Yes. value and currency are read from the top level of the event, or from the ecommerce object if they are not there, and recorded as revenue. The transaction_id is kept as a property and used to drop a reloaded purchase. The items array is not stored.
Can I stop FunnelSights reading the dataLayer?
Yes. Add data-datalayer="false" to the script tag. Everything else the tracker records carries on as before, and you can send events yourself with the funnelsights function or with CSS classes.
More in this series
This post is part of Website event tracking: a practical guide, our guide to event tracking.
- Event naming conventions: how to keep analytics reports readableThree spellings of one event make three rows in your report. A simple naming convention, agreed once, keeps your events readable for years.
- How to track outbound clicks, file downloads and form submissions without codeOutbound clicks, downloads and form submits are recorded the moment the tag goes in. Here’s what each one captures, where they trip people up, and how to name your own events with a CSS class.
- Revenue tracking in web analytics: how to see which traffic paysVisits tell you which channels are busy. Revenue tells you which ones pay. Here’s how to attach money to your events and read it without fooling yourself.
- What conversion goals should you track? How to pick the few that matterTrack twenty goals and you’ll read none of them. Here’s how to choose the conversions that matter, set them up so they stay trustworthy, and know when a number is too small to trust.
