Blog

Audit your client GTM container for stale tags

A focused 20-minute pass surfaces tags that have not fired in months, owners who have left, and triggers that point at dead pages.

Client-side GTM containers accumulate tags faster than they retire them. Each unused tag is a small drag on page performance and a small risk of unexpected behaviour. A focused 20-minute audit, run quarterly, keeps the container lean.

Step 1: list tags by last fired date

In GTM, the Versions tab shows when tags were last edited. To see when they last fired, you need a separate signal: query your GA4 BigQuery export for distinct event names from the last 30 days, and compare against the tag list.

SELECT DISTINCT event_name
FROM `your_project.analytics_XXXXX.events_*`
WHERE _TABLE_SUFFIX BETWEEN
  FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
  AND FORMAT_DATE('%Y%m%d', CURRENT_DATE())
ORDER BY event_name

Any event in your GTM tags that does not appear in the BigQuery results has not fired in a month. Probably stale.

Step 2: check tag descriptions

Open each tag. The Notes field should describe: what the tag does, who owns it, when it was last reviewed. If the field is empty, you have a tag with no documented owner. Add the description before continuing.

Step 3: look for triggers pointing at dead URLs

Triggers based on Page URL or Page Path can break silently when those URLs are removed from your site. Open each URL-based trigger and check whether the URL still exists. The trigger does not throw an error; it just never fires.

Step 4: pause before deleting

Pause the tag rather than deleting it. Publish. Wait two weeks. If nobody complains, the tag was genuinely stale and you can delete it in the next audit. If somebody complains, you re-enable in one click.

Step 5: review tag templates

In Templates, look for custom templates that no active tag references. Custom templates do not show up in the tag listing but contribute to container weight. Delete unused ones.

Step 6: tighten variable usage

In Variables, the same logic: variables not referenced by any active tag are dead weight. Remove them. The container loads faster and the next audit is shorter.

Step 7: name the next audit

When you publish the cleanup version, name it "Q1 audit: removed N stale tags." Future you will be grateful when reviewing version history.

For the matching pass on your server container, the general 30-minute audit covers the same approach with sGTM-specific differences.