Skip to main content
TagManifest /Docs Dashboard

Dead __utmz cookie reference

Tags reference __utmz cookies from Universal Analytics, which was sunset in July 2023. These cookies are no longer set by any active system, so all code reading them gets empty/null values.

On this page 6

Summary

  • rule_id — utmz-reference
  • purpose — Detect tags that read the __utmz Universal Analytics cookie, which no longer exists
  • effect — Attribution logic silently returns empty or null; downstream data is corrupted
  • layer — container
  • reversibility — non-destructive

What fires this

The rule checks all Custom HTML tags for codeAnalysis.hasUtmzReference, set by the parser when it finds __utmz in the tag code. Every matching tag is returned as an affected item, with the specific line numbers highlighted. The rule does not exclude paused tags, so paused tags are included in results.

Why it matters

Universal Analytics was sunset in July 2023. The __utmz cookie — which stored campaign attribution data written by analytics.js — is no longer set by any active system. Code that reads __utmz always receives an empty string or null. Attribution values built from that read are silently wrong, not missing. The tag continues to fire without error while producing no usable output. Any UA migration that left __utmz reads in place has a broken attribution path.

Before / after

// Custom HTML tag: Legacy UTM attribution
var utmz = getCookieValue('__utmz');  // always empty since July 2023
var campaign = parseCampaign(utmz);

dataLayer.push({ campaign_source: campaign.utmcsr });
// Read UTM params from URL directly
var params = new URLSearchParams(window.location.search);

dataLayer.push({
  campaign_source: params.get('utm_source') || ''
});

Remediation

  1. Open each flagged tag and locate every __utmz reference.
  2. Determine what attribution field the code was trying to populate (utmcsr, utmccn, utmcmd, etc.).
  3. Replace the cookie read with a direct URL parameter read using URLSearchParams.
  4. Map the legacy __utmz field names to their utm_* URL parameter equivalents.
  5. Test on a URL with campaign parameters to confirm values are populated correctly.
  6. If attribution tracking is not needed, remove the tag entirely.
  7. Publish.

Metadata

Severity
critical
Tier
error
Category
dead-code
Layer
container
Version
1
Effort
15min (about 15 minutes)
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":"utmz-reference","url":"https://example.com"}'