Tag Priority and Tag Sequencing in Google Tag Manager (GTM) help control how and when tags fire on your website. Here's a quick breakdown:
- Tag Priority: Assigns a numerical value to decide which tags start firing first. Higher numbers mean higher priority, but tags still run asynchronously.
- Tag Sequencing: Ensures tags fire in a specific order (Setup → Main → Cleanup). Each step must finish before the next starts, making it ideal for workflows with dependencies.
Quick Comparison
Feature | Tag Priority | Tag Sequencing |
---|---|---|
Purpose | Sets start order for tags | Controls strict execution order |
Dependencies | No dependency management | Manages data dependencies |
Best For | Simple, independent tags | Complex workflows with steps |
Error Handling | No error prevention | Stops if setup fails |
Use Tag Priority for simple tasks like pageview tracking or social pixels. Opt for Tag Sequencing when steps rely on one another, such as eCommerce purchase tracking or form submissions. Both tools ensure accurate tracking and reliable data when configured correctly.
Differences Between Tag Priority and Tag Sequencing
How Tag Priority Works in GTM
In Google Tag Manager (GTM), tag priority uses a numerical system to decide when tags start firing. Tags with higher priority numbers begin firing earlier, but this doesn't mean they'll finish in the same order. Tags run asynchronously, so their completion depends on processing time [3].
For instance, a tag with a priority of 20 might start before a tag with a priority of 10 but could finish later if it requires more processing time. While tag priority helps organize the starting order, it doesn't control the entire firing sequence. This is where tag sequencing comes into play for more structured control.
How Tag Sequencing Works in GTM
Tag sequencing ensures a controlled, step-by-step execution process using three key components:
Component | Function | Example Use Case |
---|---|---|
Setup Tag | Prepares data and conditions | Extracting product data from a page |
Main Tag | Executes the primary function | Sending purchase data to analytics |
Cleanup Tag | Handles post-execution tasks | Clearing temporary variables |
With tag sequencing, each step must finish before the next begins [1]. For example, the setup tag must complete before the main tag fires, and the cleanup tag runs only after the main tag finishes. This approach is especially helpful when tags rely on data prepared by earlier steps.
Tag Priority vs. Tag Sequencing: A Comparison
Here's a side-by-side breakdown:
Feature | Tag Priority | Tag Sequencing |
---|---|---|
Execution Control | Manages the starting order only | Ensures a strict step-by-step sequence |
Dependency Handling | No built-in support | Handles data dependencies effectively |
Use Case | Great for simple ordering | Ideal for complex, dependent workflows |
Error Handling | No error prevention | Stops execution if setup fails |
For straightforward tasks, tag priority is a good option. However, for more complex tracking - like custom HTML tags or workflows that depend on earlier data - tag sequencing is the better choice [2]. This distinction is particularly relevant for SaaS and eCommerce businesses managing advanced tracking setups.
Choosing the right method depends on the complexity of your tracking needs, which we'll explore further in the next section.
When to Use Tag Priority and Sequencing
Best Situations for Tag Priority
Tag priority works well when tags operate independently and just need a simple firing order:
- Tracking pageviews across multiple analytics tools
- Adding social media pixels
- Basic event tracking without relying on shared data
For example, on eCommerce pages, assign higher priority to analytics tags (e.g., priority 20) compared to marketing pixels (e.g., priority 10). This ensures that essential data collection kicks off first.
When Tag Sequencing Is Necessary
Tag sequencing is the go-to approach for workflows involving shared data or more intricate tracking setups. For SaaS and eCommerce platforms, it’s especially useful for maintaining accurate tracking during multi-step actions like sign-ups or purchases.
Here are some typical scenarios where sequencing is essential:
Scenario | Setup Tag | Main Tag | Cleanup Tag |
---|---|---|---|
Product Purchase | Extract cart data | Send purchase to analytics | Clear temporary variables |
Form Submission | Validate form fields | Track conversion | Reset form state |
User Authentication | Check login status | Send user data | Clear sensitive info |
Examples of Common Use Cases
Let’s break this down with practical examples:
Tag Priority:
- Tracking pageviews using multiple analytics tools
- Deploying social media pixels for retargeting
- Running heat mapping or session recording scripts
Tag Sequencing:
- eCommerce purchase tracking that depends on collecting product details first
- Validating form submissions before logging conversions
- Custom HTML tags that need specific page elements to load first
According to Web Star Research, tag sequencing is particularly important for marketing conversion APIs or server-side tracking configurations. These setups demand precise data flows to ensure accuracy and compliance across different platforms.
sbb-itb-38e9f15
Tips for Setting Up Tag Priority and Sequencing
Configuring Tag Priority
To set tag priority in Google Tag Manager, navigate to the Priority field under Advanced Settings. Assign higher numbers to the most critical tags to ensure they fire earlier. For example, analytics and conversion tracking tags should generally have higher priorities than marketing pixels or secondary scripts.
Setting Up Tag Sequencing
Tag sequencing ensures a smooth execution flow. Under Advanced Settings, you can assign tags as setup, main, or cleanup. Each tag will wait for the previous one to finish before firing. This setup is especially useful for complex workflows, where maintaining data accuracy depends on tags firing in the correct order.
For multi-step processes, sequencing ensures dependencies are met before the next tag executes. This prevents tracking errors and keeps your data clean and reliable.
Avoiding Common Pitfalls
Errors in tag management often arise from improper handling of dependencies or asynchronous loading. To avoid these issues:
- Use GTM's preview mode to test dependencies.
- Monitor execution times and success rates.
- Manage asynchronous components with precise callbacks and triggers.
"The asynchronous nature of Google Tag Manager means that tags can fire in any order unless specifically controlled. Tag sequencing helps manage this by allowing users to define a specific order for tags to fire." [1][2]
In setups involving multiple vendors or custom tracking solutions, combining tag priority with sequencing offers the best control. This is especially important for SaaS and eCommerce platforms, where accurate tracking directly impacts business outcomes.
Conclusion: Deciding Between Tag Priority and Sequencing
Key Points to Keep in Mind
In Google Tag Manager (GTM), tag priority and sequencing serve different purposes tailored to specific scenarios. Tag priority is best for setting a general order for tags, while tag sequencing ensures tags execute in the right order for workflows that rely on precise data handling.
Tag sequencing follows a structured approach - setup, main, and cleanup - giving you detailed control over how tags fire. For example, if you're pulling dynamic page data before triggering conversion tracking tags, this structure is essential for proper execution.
For SaaS and eCommerce companies, choosing between these methods can directly influence the accuracy of tracking and the reliability of your data. While tag priority works well for straightforward analytics and marketing tags, sequencing is the go-to for more complex setups with multiple data dependencies.
If you're aiming for effective implementation, working with experts can streamline the process and avoid potential pitfalls.
How Web Star Research Can Help
Web Star Research specializes in advanced GTM configurations tailored for SaaS and eCommerce businesses, with a focus on server-side tagging and precise data management.
Their services include:
- Reviewing your current tag setup to determine the best use of priority and sequencing
- Implementing advanced tag management solutions to ensure data accuracy
- Maintaining privacy compliance while optimizing tracking performance
- Designing custom tag sequences for intricate tracking needs