Open a tag called “Contact” and you might find a destination ID, two firing triggers and a variable called “Contact 2”. The website owner still has one simple question: what has to happen before this appears in my report? Read a GTM configuration backwards from that question.
A tag performs an action, such as sending an event to a GA4 stream. A trigger tests whether the current event qualifies. A variable supplies a value, such as the current hostname, a clicked link's address or a field supplied by the application. These objects cooperate, but they answer different questions. You can fix one and leave the other two wrong.
Build the smallest useful example
Consider a kitchen showroom with a catalogue page. It wants to know whether people open the trade price-list request panel. Opening the panel is useful interaction data. An accepted request is a separate measure of enquiries. The developer already emits a data layer message when a panel actually opens, whether it was activated by mouse or keyboard:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'request_panel_opened',
panel_kind: 'trade'
});
This is illustrative website code. First inspect your own page in Preview to establish what it actually emits. A GTM trigger named request_panel_opened does not manufacture a message. If the site exposes no suitable signal, arrange a supported hook or choose a different observable interaction. Design a data layer signal
Start with the variable. In Workspace → Variables → New, choose Data Layer Variable and enter panel_kind exactly. Name the object DLV | panel_kind. The display name is for colleagues. The value at the event is trade. On a different panel it could be retail. At initial page load it might be undefined.
Create the trigger. In Triggers → New → Custom Event, enter request_panel_opened. Select Some Custom Events and add the condition DLV | panel_kind equals trade. Name it Panel opened | trade. In ordinary English, the trigger asks “when this named message is processed, is the panel kind trade?” A visit to the trade page alone does not answer that question.
Create the tag. In Tags → New → Tag Configuration, choose Google Analytics: GA4 Event. Enter the measurement ID for the test web stream and use the emitted event name trade_panel_open. For this example the name already captures the useful distinction; adding a duplicate parameter with the same meaning is optional. Attach the Panel opened | trade trigger. Name the tag GA4 | trade_panel_open. Save the draft. The base Google tag for the chosen stream and applicable consent settings should already be in place. Google’s GA4 event-tag instructions
Predict the result before pressing Preview
| Browser action | Event under inspection | Variable on that event | Expected send |
|---|---|---|---|
| Load the catalogue | Container or page initialisation | Possibly undefined | None for this tag |
| Open the retail panel | request_panel_opened |
retail |
None |
| Open the trade panel | request_panel_opened |
trade |
One trade_panel_open |
| Close the trade panel | Different event or no event | May still contain trade |
None |
The last row catches a subtle misunderstanding. A variable can retain a value after the panel closes. If the site never produces another matching event, the value alone doesn't constantly refire the tag. Conversely, if somebody attaches an additional All Pages trigger, that trigger can run the same tag when the original custom-event condition is irrelevant.
Multiple conditions inside one trigger narrow eligibility. Separate firing triggers attached to a tag act as alternative ways for that tag to run. Adding a narrow trigger alongside an existing broad trigger leaves the broad route open. An exception can block a firing tag when the blocking trigger matches that same event. Guardrails that apply to visitor consent belong in the site's approved consent implementation. Google’s firing triggers and exceptions
Choose a variable that exists at the right moment
Page URL, hostname and path can be available early. An actual clicked link's URL belongs to a qualifying click event. A form result belongs to the point where the application knows the result. If you look at Click URL on initialisation it can be blank even when there is an excellent link near the top of the page. Enable only the built-in variables needed for the test in Variables → Configure. Google’s built-in variables for web containers
Stable categories are usually easier to maintain than visible button text, CSS styling or arbitrary private values. A button can say “Open trade list” on desktop and “Trade list” on mobile. Both can produce the same application field. For a real hyperlink with a clean, stable scheme such as a call link, a built-in click variable can be enough. The phone-link guide shows when a website change is unnecessary.
When a value looks right but fails the rule, inspect the exact result. Check letter case, extra spaces, trailing slash, Boolean versus text and the event where you inspected it. Choose an exact comparison when the contract has a finite value. Replacing equals trade with contains trade would also match nontrade and trade_archive. If both templates genuinely mean the same thing, it is often cheaper to bring them into the same documented vocabulary.
Prove the whole chain
Connect Preview, follow the site's normal test consent choice and perform the four actions in the table. Select each event individually. On the retail event, the name matches but panel_kind does not. On the trade event both conditions match. In this worked example the expected receiving result after the four actions is exactly one trade_panel_open in the intended debug-enabled GA4 stream. No customer details are needed to open either panel. If the panel collects data after opening, stop before entering it.
If the message is missing entirely, hand the example to the website developer. If the message exists but the field is absent, check the GTM data layer variable key and app timing. If the field matches but the tag stays quiet, inspect firing triggers, exceptions and consent. If the tag executes but GA4 receives nothing visible, check destination ID, debug session and browser delivery before rewriting the trigger. If you see two sends, isolate which two moments or senders produced them.
Give the version a plain description. “GA4 sends trade_panel_open on a confirmed trade-panel opening. The retail panel and a page load stay quiet.” Whoever next opens the container can compare that sentence, the configuration and the test result without knowing who originally named “Contact 2”.