Skip to main content
TagManifest /Docs Dashboard

Custom HTML replaceable by native GTM template

Custom HTML implementations exist for platforms that have native GTM tag templates available.

On this page 6

Summary

  • rule_id — replaceable-custom-html
  • purpose — Detect Custom HTML tags implementing functionality available as native GTM (Google Tag Manager) tag templates
  • effect — Custom HTML tags bypass built-in consent enforcement and require manual updates when vendor APIs change
  • layer — container
  • reversibility — non-destructive

What fires this

The rule iterates active Custom HTML tags and tests each tag's code against eleven platform-specific regex patterns. Matches are: Facebook/Meta pixel init (fbq('init'), Facebook/Meta event calls (fbq('track'), LinkedIn Insight Tag (_linkedin_data_partner_id), Google Ads conversion via gtag('event','conversion'), Hotjar (hotjar or hj( with hjid also present), TikTok (ttq.load), Snapchat (snaptr(), Reddit (rdt(), Twitter/X (twq(), Pinterest (pintrk(), and Microsoft Clarity (clarity( with clarity.ms also present). Each matching tag is returned with a specific suggested replacement. Facebook event-only calls (fbq('track') are flagged with a migration note: the init tag must move first. Paused tags are excluded.

Why it matters

Native GTM templates — from Google or the Community Template Gallery — integrate with Consent Mode automatically. A Custom HTML tag carrying the same pixel does not. It fires regardless of consent state unless you add manual checks. Templates also receive vendor-pushed updates; a Custom HTML tag stays frozen at the API version the developer copied. When a vendor changes their snippet, the Custom HTML tag silently sends the wrong payload. Replacing with a native template removes both failure modes without data loss.

Before / after

// Custom HTML tag: TikTok Pixel
!function (w, d, t) {
  w.TiktokAnalyticsObject=t;
  var ttq=w[t]=w[t]||[];
  ttq.load('AAABBBCCC111');
  ttq.page();
}(window, document, 'ttq');
Tag type: TikTok Pixel (Community Template Gallery)
Pixel ID: AAABBBCCC111
Trigger: All Pages — Page View
Consent settings: ad_storage (auto via Built-In Consent)

Remediation

  1. Open each flagged tag and note the platform and the pixel or account ID in the code.
  2. In GTM, go to Tags → New → Discover More Templates and search for the suggested template name.
  3. Create a new native tag. Enter the same account ID or pixel ID from the Custom HTML tag.
  4. Apply the same firing trigger the Custom HTML tag uses.
  5. Verify consent settings on the native tag — most ad templates activate built-in consent automatically.
  6. Run GTM Preview with both tags active. Confirm identical network requests to the vendor endpoint.
  7. Pause the Custom HTML tag and publish the container.
  8. After one reporting cycle confirms data continuity, delete the paused Custom HTML tag.

Metadata

Severity
medium
Tier
optimization
Category
quality
Layer
container
Version
1
Effort
2hr (about 2 hours)
Reversibility
non-destructive

See also

Examples

Evaluate
curl https://developer.tagmanifest.com/v1/evaluate-rule \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule_id":"replaceable-custom-html","url":"https://example.com"}'