AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Deprecated Gtm.Js Default URL In @Next/Third-Parties GoogleTagManager

The default gtmScriptUrl in @next/third-parties uses https://www.googletagmanager.com/gtm.js, which Google is deprecating. Users relying on the default will experience GTM container load failures after the deprecation date.

highConfidence 95%Next.js

Origin Analysis

The GoogleTagManager component in @next/third-parties hardcodes 'https://www.googletagmanager.com/gtm.js' as the default gtmScriptUrl, ignoring Google's deprecation notice that requires migration to 'https://www.googletagmanager.com/gtag/js'.
1. Install @next/third-parties in a Next.js project. 2. Render <GoogleTagManager gtmId="GTM-XXXXXX" /> without specifying gtmScriptUrl. 3. Inspect network requests in browser devtools. 4. Observe a request to https://www.googletagmanager.com/gtm.js instead of https://www.googletagmanager.com/gtag/js. 5. After Google deprecation date, the GTM container will fail to load.

Fixing Code Block

Edge Case Audit

Rolling back to a previous version will restore the old default. Users with Content Security Policy or network rules allowing only gtm.js must update those rules. Verify that existing custom GTM configurations work with gtag.js before deploying. The fix should be coordinated with Google's deprecation timeline.

Ecosystem Topology