Managing multiple tags in Google Tag Manager can become complex, especially when certain scripts need to execute in a specific order to ensure compliance and data accuracy. Tag sequencing allows you to control the firing order of tags, which is crucial for scenarios like implementing consent management tools, cookie blockers, and analytics tracking. This guide will walk you through the concept of tag sequencing and how to implement it effectively in GTM.
What is Tag Sequencing?
Tag sequencing is a feature in GTM that enables you to specify the order in which tags fire. This is particularly important when:
You have dependencies between tags (e.g., a tracking tag should fire only after a consent tag).
Certain scripts must load in a specific order to function correctly.
You need to ensure compliance with regulations like GDPR or CCPA.
Step 1: Setting Up Tag Sequencing in GTM
1.1 Create Your Tags
First, create the tags you want to implement in GTM. For this example, let’s say you have the following tags:
Consent Management Tag: Ensures user consent for tracking.
Analytics Tag: Captures user interactions after consent is granted.
1.2 Configure the Consent Management Tag
Go to Tags in GTM and click New.
Choose Tag Configuration and select the type of tag for your consent management solution.
Set up the tag as needed.
Under Triggering, select the trigger that should activate this tag (e.g., All Pages).
1.3 Configure the Analytics Tag
Create a new tag for your analytics tracking.
Select Tag Configuration and choose your analytics type (e.g., GA4 Event).
Set up the parameters you want to track.
Important: Do not set any triggering at this point. We will configure the sequencing next.
Step 2: Implementing Tag Sequencing
2.1 Access the Tag Sequencing Settings
In the tag configuration for your Analytics tag, scroll down to the Advanced Settings section.
Click on Tag Sequencing to expand the options.
2.2 Set Up the Sequence
Choose “Fire a Tag Before”: Select your Consent Management Tag. This ensures that it will fire before the Analytics tag.
Choose “Fire a Tag After”: If you have additional tags that need to fire after the Analytics tag, you can specify those here as well.
Example Configuration:
Before Tag: Consent Management Tag
After Tag: Additional tracking tags (if any)
2.3 Set Triggers for the Tags
Consent Management Tag: Ensure it fires on page load or specific user interactions as defined.
Analytics Tag: Since it’s set to fire only after the Consent Management Tag, you’ll use a trigger that activates after user consent is obtained (e.g., a custom event or a data layer event).
Step 3: Testing Your Tag Sequence
3.1 Use GTM Preview Mode
Click on the Preview button in GTM to enter Preview Mode.
Open your website in a new tab, and use the Debugger pane to observe tag firing.
3.2 Verify the Order of Execution
Ensure that the Consent Management Tag fires first, followed by the Analytics Tag.
Check that the analytics tracking occurs only after consent is granted.
Step 4: Validating Compliance and Data Accuracy
4.1 Monitor Data Collection
After implementation, monitor your analytics platform to verify that data is being collected accurately and in compliance with consent regulations.
4.2 Adjust Based on User Feedback
Gather user feedback and data to refine your consent management process and analytics tracking.
Ensure that users who opt out of tracking do not have their data captured by analytics tags.
Why do this?
Tag sequencing in Google Tag Manager is a powerful feature that allows marketers to control the order of tag firing, ensuring compliance with regulations and data accuracy.
By properly setting up your tags, configuring sequencing, and testing your implementation, you can create a robust tracking setup that aligns with your business goals.
As you manage complex tracking scenarios, effective tag sequencing will enhance your ability to gather reliable insights and maintain compliance.
Partner with true industry veterans at The Move. We specialize in Google Ads, SEO, HubSpot Services, CRO and Analytics. Driving growth through tailored custom strategies for Paid Media, SEO and HubSpot. Maximize your ROI, boost organic search rankings, streamline marketing processes, and make data-driven decisions with our innovative strategies and access to the industries best tools.