One click, three pushes: picking the right dataLayer event
Adding to cart rarely fires one event. What a real storefront pushes, which of them a trigger should use, and the four kinds of push that are never the answer.
The instruction sounds simple: click add to cart, see what the page pushes, build a trigger on it. Then you do it on a real storefront and three things arrive within half a second, and only one of them is the one you want.
One action is not one push
A themed storefront usually fires its own button event first, then the analytics one a moment later. A
product card can push select_item and then view_item. A cart widget adds its own
cart_updated afterwards.
Taking the first push is the honest answer to "what did that click do" and the wrong answer to "what should my trigger listen for". So the useful thing is not to pick one — it is to keep the ones that arrive in the seconds after and let you choose. A twelve-second window and a handful of candidates covers a click; longer and you start catching the next thing you did.
Tag Master's Pick Event does exactly this: arm it, do the thing on the page, and it shows what was caught alongside the other pushes the same action produced — then turns your choice into a Custom Event trigger name and the Data Layer Variables to create.
Four kinds of push that are never the answer
Anything watching the dataLayer has to ignore these, or it will confidently catch the wrong thing:
- Container lifecycle events.
gtm.js,gtm.dom,gtm.loadand friends arrive on every page load. They are the container talking to itself, and they win any race against a real interaction. - Pushes with no event name. A push that only carries data is staging values for a later event. It happened, but it is not something that happened to the visitor.
- The ecommerce reset. The recommended pattern is to push
{ ecommerce: null }immediately before every commerce event, to clear the previous one. It therefore precedes every single purchase and add-to-cart — so anything picking the next push after your click catches the clearing rather than the thing itself. - gtag setup calls.
gtag('js', new Date()),gtag('config', 'G-…')andgtag('set', …)all land in the dataLayer. Treat them as events and you end up offering a Custom Event trigger namedjs— one that will never fire on purpose.
The naming trap in gtag
A site using gtag('event', 'add_to_cart', {…}) puts the string event in the
dataLayer's event field, because that is the gtag command. The name you actually want —
add_to_cart — is the second argument.
Read the raw field and every gtag-based site looks like it fires one event called "event". This is worth
knowing even by hand: when the dataLayer in your console shows event: "event", look at the
arguments, not the key.
Which parameters to take
Once you have the right push, the question is which of its fields become variables. Two rules save most of the thinking:
- The money is almost always wanted: value, currency, transaction ID. Reasonable to select by default, easy to unselect.
- Only at the top level.
ecommerce.valueis the order.ecommerce.items.0.priceis the price of the first item, which is not the same thing and is rarely what a conversion tag should send.
And if you switch to a different candidate, drop the ticks. They described the shape of the other event; carried across, they name paths the new one does not have.
Keep them, then export once
Picking one event is rarely the whole job. A funnel is four or five of them, and walking it once while keeping each catch beats going back for them one at a time — the kept set survives while you move to the next page.
What comes out at the end is a single JSON file, and it is worth being exact about what kind. It is a GTM container export, not a dump of your events: a Data Layer Variable per path, a Custom Event trigger per event, and a tag wired to each. You import it into GTM, not back into the extension — there is no loading that file to restore a session. What that file has to contain is a guide of its own, including the two fields that make GTM refuse the whole import.
A routine
- Arm the picker before you interact, not after. The push you want has already happened otherwise.
- Do one thing. One click, then stop, so the candidate list describes that click and not three.
- Read the alternatives before accepting the catch. If the first one is the theme's own event, the one you want is usually the next.
- Check the event name against what the tag will listen for — including capitalisation, which is a different event to GTM.
- Repeat through the funnel, keeping each one, before you go near the container.
Related guides
- How to debug server-side GTM
- Debugging Consent Mode V2: gcs, gcd and the violations nobody catches
- Tag Assistant alternative in 2026
Try it on your own site
Tag Master is free, needs no account, and collects no data.
Add to Chrome — Free