Blog

Data collection crossroads: When to use RudderStack or Google Tag Manager (or both)

BLOG
Data Integration

Data collection crossroads: When to use RudderStack or Google Tag Manager (or both)

Luke Johnson

Luke Johnson

Customer Success Architect

Data collection crossroads: When to use RudderStack or Google Tag Manager (or both)

At first glance, RudderStack and Google Tag Manager (GTM) occupy similar territory in the data stack for many organizations. Both tools facilitate the collection and routing of behavioral event data. However, they solve this problem in different ways, prioritizing the needs of different teams, and offering divergent visions for how behavioral data should be collected.

GTM provides a clean, accessible UI for loading and orchestrating tags (JavaScript snippets) on websites. Its value comes from reducing reliance on engineering resources, allowing marketers and other non-engineers to manage data collection outside the release cycle. This often leads to dozens - or even hundreds - of ad pixels, martech tools, and analytics platforms loading and firing directly in the user’s browser as they traverse the site. GTM also offers a server-side variant with limited capabilities and a heavy emphasis on other tools in Google’s marketing ecosystem.

RudderStack provides Customer Data Infrastructure (CDI) built for technical teams to manage event collection, transformation, and routing. RudderStack is compatible with a variety of data sources, including websites, mobile apps, server environments, and webhooks. RudderStack supports client-side scripts in a similar manner to GTM, but its primary value lies in its vast library of server-side integrations. These cloud-mode pipelines allow for robust data quality, transformation, enrichment, and observability features, while reducing the chaos and performance impacts of client-side tagging.

RudderStack works best as a standalone data collection tool. Many RudderStack customers are eager to migrate away from GTM entirely as they modernize their data stack. For other customers, the path forward is less clear. GTM and its data layer are often deeply embedded and linked to countless systems and processes that make it a necessary compromise - especially for enabling teams outside the engineering org.

In this post, we’ll review three options for how to implement RudderStack with GTM, based on experience we’ve gathered across thousands of implementations.

Option 1: Remove GTM entirely and replace it with RudderStack

The healthiest implementations of RudderStack are usually a reflection of organizational alignment. When engineering teams, data teams, and data consumers are coordinating effectively, they don’t need GTM at all. Our most successful customers use RudderStack without GTM to power data collection use cases while improving site performance (leading to higher conversions), ensuring robust data accuracy (reducing costly errors), and increasing reliability (minimizing downtime).

Migrating away from GTM can require significant effort, but the benefits are worthwhile for well-resourced technical teams in pursuit of best-in-class event pipelines without compromise.

How to migrate from GTM to RudderStack:

  • Instrument the RudderStack JavaScript SDK directly in the application.
  • Where possible, repurpose trigger logic from the existing GTM dataLayer to ensure compatibility.
  • Take advantage of our Data Quality Toolkit to lock down schemas and ensure a successful implementation.

💡Tips: Some customers migrate gradually, moving destinations from GTM to RudderStack over time and eventually sunsetting GTM altogether. Others are able to complete the migration all at once with a hard cutover. Our Customer Success team can help advise on the best approach for your organization.

Option 2: Implement GTM as a destination in RudderStack

RudderStack’s SDK works best as the core data layer for event collection, with event calls hard-coded into the application by engineers. If GTM is a requirement, it can be added as a destination in RudderStack. Our SDK will load the GTM container on the page and automatically push events to the dataLayer. This lets non-engineers retain control over tags without introducing dependencies to the core CDI pipeline.

While it may not be ideal for page performance, this approach mitigates some of the downsides of having GTM load RudderStack (see below). GTM can still allow non-engineers to self-serve their own tags as needed. If GTM is blocked by adblockers, RudderStack pipelines won’t be impacted.

How to add GTM as a destination in RudderStack:

  • Instrument the RudderStack JavaScript SDK directly in the application.
  • Add a new GTM destination, and input your container ID.
  • Adjust configuration details as needed.
  • Connect it to the corresponding JavaScript source.

Option 3: Implement RudderStack as a tag in GTM

If a fleshed-out GTM implementation is already in place, adding RudderStack as a tag is a trivial exercise. This approach massively improves the time-to-value of implementing RudderStack, often without the need for engineering resources. Marketing, analytics, and data teams – especially those with limited engineering support – can retain control and flexibility over data collection by using GTM as an intermediary between the application and event pipelines.

While this approach has its advantages, it also comes with significant downsides. GTM can create dependencies that affect the flow of data into RudderStack - race conditions and page performance issues can make event collection less reliable. Troubleshooting errors is often more difficult, with multiple points of failure added before any events are sent. If GTM is blocked by adblockers, RudderStack will also be blocked, causing significant impacts to data collection and potentially invalidating certain use cases.

How to add RudderStack as a tag in GTM:

  • Configure RudderStack’s JavaScript SDK as a custom HTML tag in GTM. Or, for better results, have engineers add the SDK snippet to the page directly.
  • Add RudderStack tags using our tag template in the GTM community gallery.
  • Configure triggers and variable mappings as needed.

The bottom line: Deploying RudderStack and Google Tag Manager in tandem can help bridge important gaps across teams, despite introducing some tradeoffs. However, the most performant RudderStack implementations serve as a full replacement of GTM.

Not sure how to proceed? Schedule some demo time with our team to help you evaluate these tradeoffs and find the best path forward for your organization.

CTA Section BackgroundCTA Section Background

Start delivering business value faster

Implement RudderStack and start driving measurable business results in less than 90 days.

CTA Section BackgroundCTA Section Background