SiteAud!tLint Support

Opportunity Tracking & Analytics

Marketing tag hard-coded outside GTM

Severity
Opportunity
Impact
Low
Effort to fix
Medium
Issue code
track_outside_gtm

Why it matters

The site uses GTM, but this pixel is hard-coded in the page. That makes it harder to control consent, test changes, and avoid firing it twice.

How to fix it

Move the pixel into GTM (most have a template) and remove the hard-coded copy.

What this means

The site uses Google Tag Manager, but a marketing or behaviour tool is hard-coded in the pages instead of being loaded by GTM. The evidence names the tool and how many pages have it, for example Meta Pixel is hard-coded on 120 page(s) instead of loaded by GTM.

Why it matters

  • Duplicates. Someone later adds the same tool in GTM without knowing it is already in the code, and every event is counted twice.
  • Consent. Tags in GTM can follow your consent settings in one place. Hard-coded tags often fire before consent. See Tracking before consent.
  • Control. Marketers cannot change, pause or audit a hard-coded tag without a developer and a release.

When it is fine

Platform integrations that also handle server-side events, such as Shopify's Meta channel with the Conversions API, can be the better choice. Then make sure GTM does not load the same tool too.

How to fix it

  1. Recreate the tool's tag in GTM, with the same ID and events, and the right triggers and consent settings.
  2. Test it in GTM's Preview mode.
  3. Remove the hard-coded snippet from the theme or templates in the same release, so there is no gap and no overlap.
  4. Publish the container.

Verify the fix

Recrawl. Improve > Tracking & Pixels shows how each tool is loaded on every page. See Google Tag Manager audit.

How it affects your score

Tracking issues have their own Tracking score and never lower the SEO site health score. They still appear in the Action Plan, the issues CSV, Slack messages and Linear tickets. A smaller improvement with a modest effect on its own.

Find the affected URLs

Open Crawl > Issues and pick Marketing tag hard-coded outside GTM. Each affected URL is listed with its evidence, and Copy URLs or Export URLs hands the list to a developer. The issue also appears in the Action Plan, ranked by impact (low) and effort (medium), and in the issues CSV under the code track_outside_gtm. After fixing, run a new audit and use Compare to confirm the URLs moved to fixed.

Guides that cover this issue