RudderStack GTM Template Refreshed for JavaScript SDK v3

The RudderStack Google Tag Manager community template has been reworked for JavaScript SDK v3. It now covers the full v3 API surface, reports tag failures instead of silent no-ops, and adds a native SDK-loading path.
Available Plans
  • free
  • growth
  • enterprise

Version 1.1.0 of the RudderStack tag template in the Google Tag Manager Community Template Gallery reworks the integration for JavaScript SDK v3. The previous template only supported page, track, and identify against SDK v1.1.

This version of the template brings it in line with the current SDK and closes a class of “tag fired but nothing was sent” failures that were hard to diagnose from GTM alone.

What’s new

  • Full JavaScript SDK v3 API surface: The template’s Call dropdown now includes every documented v3 API — page, track, identify, group, alias, consent, reset, startSession, endSession, setAnonymousId, setAuthToken, setCustomContext, and clearCustomContext — each with fields that map directly onto the SDK’s arguments.
  • Meaningful failure reporting: When the SDK isn’t on the page at call time, the tag now reports a failure with a reason in the GTM debug console instead of reporting success and silently dropping the event. Previously, GTM showed the tag as Fired, the console was clean, no request left the browser, and everything looked healthy on inspection.
  • Native SDK-loading tag (Method 1): A new load call lets you install the SDK directly from the template — no Custom HTML tag, no hand-pasted snippet. Set Call to load, fill in your write key and data plane URL, and attach it to the Initialization - All Pages trigger. This is also the only path that works for organizations that disable Custom HTML tags in GTM for security review.
  • Custom HTML setup (Method 2) still supported: Continue to use a Custom HTML tag when you need to pin a specific SDK version, self-host the SDK, or express load options in JavaScript rather than in a GTM variable.
The native SDK-loading tag depends on a CDN-hosted loader artifact (loader-gtm.min.js) that is being built and released from the rudder-sdk-js monorepo. Until that artifact ships, continue to install the SDK via a Custom HTML tag (Method 2). The template’s load call is already in place, so you don’t need a template update once the loader is published.

Supported calls and minimum SDK versions

CallMinimum JavaScript SDK version
page, track, identify, group, alias, consent, startSession, endSession, setAnonymousId, setAuthToken3.0.0
reset (always sends ResetOptions; never the deprecated boolean)3.24.0
setCustomContext, clearCustomContext3.32.0

The three original calls (page, track, identify) still work against SDK v1.1, but every other call requires v3.

Trigger ordering: use Initialization - All Pages for SDK setup

The SDK-loading tag — whether the new load call or a Custom HTML tag — must fire on the Initialization - All Pages trigger, not All Pages. GTM guarantees that every Initialization tag completes before any Page View tag starts, but within a single event tag order isn’t guaranteed. If the SDK tag and your event tags share the All Pages trigger, a page tag can win the race, find no window.rudderanalytics, and dispatch nothing. Previous versions of the template reported success in that case; version 1.1.0 reports a tag failure with a reason.

Verify your setup

Pair GTM Preview with the RudderStack Assistant browser extension. GTM Preview confirms whether the tag fired; RudderStack Assistant confirms whether the event actually left the browser and what the payload looked like. Together they eliminate the “fired but nothing sent” failure mode. The extension requires JavaScript SDK v3 or later.

Resources

Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.