GTM’s trigger system answers the question “when should this tag fire?” It does not answer “in what order should tags fire relative to each other?” or “what should happen before this tag fires?”
Tag sequencing and firing priority are the tools that answer those questions. They are underused, often misunderstood, and responsible for a category of subtle tracking bugs that are difficult to diagnose after the fact.
This post covers how both mechanisms work, the practical scenarios where they matter, and how to configure them correctly.
Why Order Matters in GTM
Multiple tags often fire on the same trigger. When the page loads, you might have:
- A Consent Check tag
- The Conversion Linker tag
- A GA4 Configuration tag
- A Google Ads Remarketing tag
- A custom data layer initialization tag
If these all fire simultaneously, on the same trigger, with no order enforced, the behavior depends on browser execution timing and GTM internals. Most of the time, it works. In edge cases — especially on slow connections, with heavy pages, or when one tag depends on data another tag writes — it breaks silently.
The two specific bugs that tag ordering prevents:
-
Conversion Linker fires after conversion tags. The GCLID needs to be stored in a cookie before any conversion tag tries to read it. If the Conversion Linker fires after a conversion tag on the same page load, the cookie does not exist yet when the conversion tag fires.
-
Consent tag fires after data collection tags. If you are using a consent management platform and checking consent state before sending data, the consent check must complete before any tag that sends data fires.
Mechanism 1: Firing Priority
Every GTM tag has a firing priority setting. It is a number. Higher numbers fire first. The default is 0.
To set firing priority: open a tag, go to Advanced Settings, and set the Priority value.
Tags with the same priority fire in an undefined order. Tags with higher priority fire before tags with lower priority on the same trigger.
Practical priority settings to use:
| Priority | Tags |
|---|---|
| 100 | Consent initialization, CMP integration tags |
| 50 | Conversion Linker, Google tag base configuration |
| 10 | GA4 Configuration tag, Google Ads Conversion Tracking base |
| 0 (default) | All event tags (purchases, form submissions, etc.) |
| -10 | Tags that depend on data written by other tags |
This is simple and effective for most cases where you just need one category of tags to consistently run before another.
Firing priority does not guarantee that a tag has finished executing before the next one starts. For tags with asynchronous behavior, a higher priority only means they started loading first, not that they completed first.
Mechanism 2: Tag Sequencing
Tag sequencing is the stronger guarantee. It lets you specify:
- A Setup Tag that must fire (and optionally must succeed) before the main tag fires.
- A Cleanup Tag that fires after the main tag fires, regardless of success or failure.
To configure: open a tag, go to Advanced Settings, expand Tag Sequencing.
Setup Tag: The main tag fires only after the Setup Tag has fired. You can optionally require that the Setup Tag fired successfully (based on whether it returned without errors).
Cleanup Tag: The Cleanup Tag fires after the main tag, whether or not the main tag succeeded.
Use Case 1: Ensuring Conversion Linker Always Fires First
This is the most common and important sequencing use case.
The problem: Your thank-you page fires a Google Ads Conversion tag and a GA4 Purchase event. The Conversion Linker also fires on All Pages. On most page loads the Conversion Linker happens to fire first, but on slow connections or when the page is cached, the conversion tags occasionally fire before the Conversion Linker has stored the GCLID cookie.
The fix: Set the Conversion Linker as the Setup Tag for every conversion tag.
Configuration:
- Open your Google Ads Conversion tag.
- Advanced Settings > Tag Sequencing.
- Setup Tag: select your Conversion Linker tag.
- Check “Don’t fire [tag] if [setup tag] fails to fire.”
Repeat for every conversion tag in the container.
Now the conversion tag will not fire until after the Conversion Linker has executed. The GCLID is in the cookie before the conversion tag looks for it.
One important note: this means the Conversion Linker fires once via the All Pages trigger, and again as a Setup Tag before each conversion tag. The Conversion Linker is idempotent (it just reads the URL and writes a cookie), so firing it twice is harmless.
Use Case 2: Consent Check Before Data Collection
You have a consent management platform. You have a custom tag that checks whether the user has accepted analytics cookies. No analytics tags should fire until this check has been confirmed.
Setup:
- Create a Custom HTML tag named “Consent Check” that reads your CMP’s consent state and returns cleanly if consent is granted, or throws an error if it is not.
<script>
(function() {
// Example: Cookiebot
if (typeof Cookiebot === 'undefined' || !Cookiebot.consent.statistics) {
throw new Error('Statistics consent not granted');
}
})();
</script>
- Set this “Consent Check” tag as the Setup Tag for your GA4 Configuration tag.
- Enable “Don’t fire [GA4 Config] if [Consent Check] fails to fire.”
If consent is not granted, the Consent Check tag throws an error, GTM marks it as failed, and the GA4 Configuration tag does not fire.
This is a belt-and-suspenders approach alongside Google Consent Mode. It is especially useful when you need strict control and cannot rely purely on Consent Mode’s modeled behavior.
Use Case 3: Chaining Dependent Tags
You have a Custom HTML tag that initializes a global JavaScript object that subsequent tags rely on. If the initialization tag has not run, the subsequent tags error out.
Example: you have a tag that builds a window.trackingContext object with user data, and your GA4 tags read from that object.
Setup:
- Tag A: “Initialize Tracking Context” - Custom HTML that builds
window.trackingContext. - Tag B: “GA4 - Enhanced Purchase” - reads
window.trackingContext.userId.
Set Tag A as the Setup Tag for Tag B. Tag B will not fire until Tag A has run.
For cases where you have many tags that all depend on the same initializer, use firing priority instead: give Tag A a priority of 50, leave all dependent tags at 0. The initializer runs first, then all dependent tags run.
Use Case 4: Cleanup After Tag Execution
Cleanup Tags run after the main tag, regardless of success. Use cases:
- Resetting data layer variables after a conversion event (if you need to prevent the same purchase data from being picked up by a subsequent page event on a SPA).
- Logging or diagnostics after a tag fires (push a “tag fired” flag to the data layer for debugging purposes).
- Resetting UI state after an interaction tracking tag fires.
Example: after a purchase tag fires, a Cleanup Tag pushes an ecommerce: null reset to the data layer so the purchase data does not persist into the next virtual pageview.
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null });
</script>
Configure this as the Cleanup Tag on your GA4 Purchase event tag.
Combining Priority and Sequencing
Priority and sequencing are complementary tools, not alternatives.
Use firing priority when:
- You need one category of tags to generally fire before another.
- The order matters but not strictly (you are okay with slight timing variation).
- You are managing many tags and cannot chain them all individually.
Use tag sequencing when:
- The dependent tag must not fire at all if the prerequisite tag fails.
- You need a guaranteed hard dependency between two specific tags.
- You need cleanup behavior after a specific tag.
A practical setup for a typical e-commerce GTM container:
- Consent initialization tags: Priority 100
- Conversion Linker: Priority 50, and also set as Setup Tag on all conversion tags
- GA4 Configuration: Priority 10
- All event tags (purchase, add to cart, form submit): Priority 0, with sequencing on conversion tags specifically
- Data layer reset tags: Cleanup Tags on purchase/conversion tags
What Tag Sequencing Does Not Do
Tag sequencing does not make tags wait for asynchronous operations in the setup tag to complete. If your Setup Tag makes an API call and you need the result before the main tag fires, sequencing does not help — GTM fires the main tag after the Setup Tag script has executed, not after any promises or callbacks inside it resolve.
For async dependencies, the pattern is: the async operation completes, pushes a custom event to the data layer, and that event triggers the main tag. No sequencing needed; the trigger handles the timing.
Diagnosing Tag Order Issues in GTM Preview
In GTM Preview mode, each event in the left panel shows all the tags that fired. The order in the list reflects the order they fired.
To verify your sequencing is working:
- Enable Preview.
- Trigger the event (page load, purchase, etc.).
- In the Preview panel, select the event and go to Tags.
- Look at the “Fired” tags list. Tags are listed in the order they fired.
- Confirm your high-priority tags and setup tags appear before their dependents.
If a tag shows as “Not Fired” when you expected it to fire, check whether its Setup Tag fired successfully. A Setup Tag that threw an error will prevent the dependent tag from firing.
Key Takeaway
Tag sequencing and firing priority are the controls that give you deterministic behavior in a container where multiple tags fire on the same trigger. Without them, tag firing order is unpredictable and dependent on network timing and browser behavior. With them, you have explicit guarantees: the Conversion Linker runs before conversion tags, consent is verified before data is sent, and initialization logic runs before anything that depends on it.
For any GTM container managing conversion tracking, set the Conversion Linker as a Setup Tag on all conversion tags. This is the single highest-impact configuration change you can make for attribution reliability.
Up next in the GTM Expert Series: How to Scrape and Use DOM Data in GTM Without a Developer
Related Posts
Element Visibility Trigger Not Firing on Elementor Form Success: A GTM Troubleshooting Guide
Tracking a Next.js SPA in GTM: History Navigation, Invisible Carts, and Full E-Commerce Setup
When Preview Mode Lies: Runtime-Level HTTP Logging for Server-Side GTM
Need Help With Your Google Ads?
I help e-commerce brands scale profitably with data-driven PPC strategies.
Get In Touch