Most Google Tag Manager problems are firing problems: a tag that should have fired and didn’t, or fired when it shouldn’t have. But there is a quieter category of bug that drives analysts mad, where every tag fires correctly and the data still comes out wrong. The cause is usually order. An event tag fired before the configuration it depends on, or a pixel fired before the consent script gave it permission. Tag Sequencing is GTM’s answer: a built-in way to declare that one tag must fire before or after another, and what should happen if the first one fails.
What Tag Sequencing Actually Does
Tag Sequencing lets you attach ordering rules to any tag. You can specify that a setup tag fires before your main tag, that a cleanup tag fires after it, and, crucially, that the main tag should only fire if its setup tag succeeded.
Without sequencing, GTM makes no promises about order. Tags attached to the same trigger fire asynchronously, which means the browser starts them all and lets them race. Most of the time the race resolves harmlessly. Some of the time it does not, and you get the classic symptoms: events missing parameters, conversions attributed to nobody, tracking scripts firing for users who never consented. Sequencing replaces the race with a queue.
The need shows up in four recurring situations. One tag genuinely depends on another, the way an event tag depends on its configuration tag. Scripts must load in a specific order because the second reads something the first creates. Asynchronous loading creates race conditions that only appear on slow connections, which makes them miserable to debug. And consent compliance demands that nothing tracks until the consent script has run.
The Two Sequencing Directions and Two Safety Switches
GTM offers two directions. A setup tag fires before your main tag, and a cleanup tag fires after it. Both are configured on the main tag itself, not on the setup or cleanup tag, which trips people up on their first attempt.
Alongside the direction, two checkboxes do the heavy lifting. Wait for Tags pauses the main tag until the setup tag finishes executing, with a timeout you define so a hung script cannot block your tracking forever. Don’t fire if previous tag fails (the validation check) goes further: if the setup tag errors out or never fires, the main tag stays silent entirely.
The distinction matters because they solve different problems. Waiting solves timing: the main tag fires late rather than early. Validation solves permission: the main tag fires conditionally rather than unconditionally. For a critical dependency you usually want both.
Setting It Up
The configuration lives in a place nobody finds by accident. Open the tag that has the dependency, scroll to Advanced Settings, and expand Tag Sequencing. From there:
1. Open the MAIN tag (the one that depends on something else)2. Advanced Settings → Tag Sequencing3. Tick "Fire a tag before this tag fires"4. Select the setup tag from the dropdown5. Enable "Wait for Tags" and set a timeout (2000-3000 ms is typical)6. Optionally tick "Don't fire if previous tag fails"
The same panel offers “Fire a tag after this tag fires” for cleanup work, useful for things like firing a logging tag once the main tag has done its job.
Two Scenarios That Cover Most Real Usage
The first is the configuration dependency. GA4 event tags rely on the configuration tag (the Google tag, in current GTM terminology) having initialized first. If an event races ahead of the configuration, it can arrive at GA4 malformed or not at all. The fix takes a minute: on each GA4 event tag, set the configuration tag as a setup tag with Wait for Tags enabled. The event now waits politely for the foundation it stands on.
The second, and the one with legal teeth, is the consent dependency. Suppose a Meta Pixel must not fire until a cookie consent script has executed:
Tag: Meta PixelSetup tag: Cookie Consent TagWait for Tags: enabled, timeout 3000 msValidation: "Don't fire if previous tag fails" enabled
The validation checkbox is what makes this compliant rather than merely tidy. If the consent script fails to load, breaks, or is blocked, the pixel does not fire at all. Without that checkbox, a broken consent script would fail silently and your pixel would happily track everyone, which is precisely the situation that ends with a privacy complaint. Sequencing here is a guardrail: the tracking is structurally incapable of outrunning the consent.
If consent is your main use case, it is worth knowing that modern setups often pair or replace this pattern with GTM’s built-in consent mode and CMP integrations, which handle the same problem declaratively. Sequencing remains the right tool when your consent logic lives in a custom script, and either way the implementation deserves proper QA, the kind covered in my guide to testing a OneTrust consent implementation.
A Complete Walkthrough: Consent Before Analytics
Here is the full GDPR-flavored setup end to end. First, the consent tag itself: a Custom HTML tag deploying the cookie consent script, triggered on All Pages. Second, the analytics tag, with sequencing configured:
Tag: Google AnalyticsSetup tag: Cookie Consent TagWait for Tags: enabled, timeout 3000 msValidation: "Don't fire if previous tag fails" enabled
Third, and not optional: testing. Enter Preview mode, load the site, and check the firing order in Tag Assistant. You should see the consent tag execute first, then the analytics tag, and on a page where you simulate a consent script failure, the analytics tag should not fire at all. The whole point of sequencing is a guarantee, and a guarantee you have not tested is a hope.
Best Practices That Keep Sequencing Sane
The strongest advice is restraint. Sequence only the tags that genuinely depend on each other. Every sequence adds a thread of coupling to your container, and a container where everything waits on everything else is slow, fragile, and impossible to reason about. Configuration-before-event and consent-before-tracking are real dependencies; most other orderings people imagine they need are not.
Keep timeouts realistic. Somewhere between 2000 and 5000 milliseconds covers nearly every legitimate case. A timeout that is too short fails on slow mobile connections exactly when you can least afford data loss; one that is too long lets a hung script delay your tracking for ages.
Document every sequence in the tag’s notes field, with something as plain as “Sequencing: fires after Cookie Consent Tag, validation on.” Six months from now, someone auditing the container will see a tag mysteriously not firing and tear their hair out unless the note tells them the silence is intentional.
And retest sequences whenever the container changes. Sequencing bugs are quiet ones: nothing errors, nothing turns red, the data just degrades. Preview mode before every publish is the habit that catches them.
The Mistakes Everyone Makes Once
Getting the direction backwards is the classic: configuring the dependency on the setup tag instead of the main tag, or choosing “after” when you meant “before.” The mental check is to always start from the dependent tag, the one that needs something else, and configure its setup tag from there.
The second mistake is enabling Wait for Tags but skipping validation on a compliance-critical sequence. Waiting only delays the main tag; it does not stop it. If the setup tag fails, the main tag fires anyway once the timeout expires, which for a consent dependency defeats the entire purpose. When firing without the setup tag would be wrong rather than merely suboptimal, validation is not optional.
The third is trusting the configuration without watching it run. Sequencing behavior interacts with page speed, script errors, and ad blockers in ways that only show up live. Preview mode costs two minutes; an undetected sequencing failure costs weeks of corrupted data.
The Short Version
Tag Sequencing turns GTM’s firing free-for-all into a controlled order: setup tags before, cleanup tags after, with Wait for Tags handling the timing and validation handling the permission. Use it for the two dependencies that genuinely matter, configuration before events and consent before tracking. Keep timeouts in the 2000 to 5000 millisecond range, write the note, test in Preview, and resist the urge to sequence things that do not need it. The best sequencing setup is a small one that you can explain in one sentence per tag.
See you soon.
[…] GTM Tag Sequencing: Controlling the Order Your Tags Fire […]