Skip to main content
TagManifest /Docs Dashboard

Performance rules

Checks that detect duplicate script loading, render-blocking patterns, jQuery dependencies, and inefficient trigger scope in GTM containers.

On this page 5

Performance rules measure the page-load cost of your tag stack. GTM tags execute on every qualifying page load, and the cumulative weight of those tags — the scripts they fetch, the code they run — affects how fast your pages render.

Custom HTML tags are particularly consequential. They operate outside GTM's normal execution model. They can load external scripts synchronously, block rendering, and introduce dependencies that fail silently if not satisfied in the right order. The performance category focuses on patterns where the execution cost is higher than necessary for what the tag accomplishes.

What this category covers

The four current rules cover the most common sources of unnecessary tag overhead.

Redundant network requests happen when two tags independently load the same external library. Each tag fetches the script separately, creating duplicate requests for a resource that only needs to load once. Beyond bandwidth, two instances of a library initializing on the same page can interfere with each other in ways that are difficult to reproduce and debug.

Render-blocking code happens when tags use document.write(). This API blocks the browser's HTML parser while it executes. On slow connections, or when called after the initial page load, it can produce a blank page. Chrome has warned about this pattern since 2016. When it appears in a modern container, it usually arrived via a migration that carried over legacy implementation patterns without review.

Silent dependency failures happen when custom HTML tags use jQuery without confirming jQuery is available. GTM does not bundle jQuery. If a tag using $() or jQuery() fires before jQuery loads, the tag fails with no visible error in GTM's preview mode and no browser console output unless you happen to be watching.

Wasted trigger scope happens when a tag fires on All Pages but contains URL-checking logic inside its JavaScript. The tag loads, parses, and executes on every page — then does nothing on pages that don't match the URL condition. Moving that condition to a GTM trigger filter prevents the tag from loading at all on irrelevant pages.

These patterns compound in containers with many custom HTML tags. One redundant script load is a minor issue. Six of them, across six different vendor tags, represents meaningful overhead.

How findings are tiered

All four performance rules are optimizations. None rises to error or warning level because these patterns do not cause data loss or break analytics flows. They reduce page performance, increase JavaScript parse overhead, and make containers harder to maintain — but they do not stop tags from firing.

Optimizations carry a lower urgency than errors and warnings, but they are not cosmetic. A duplicate script load is a real network request on every qualifying page load. The health score applies smaller deductions for optimizations than for errors, but the deductions accumulate if a container has multiple findings.

Rules in this category

All performance rules are currently optimizations. There are no error-tier or warning-tier rules in this category.

Optimizations

  • all-pages-url-specific — Tags fire on every page but contain URL-checking logic; use a targeted trigger instead.
  • document-write — Tags use document.write(), which blocks page rendering and can cause blank pages.
  • duplicate-external-script — The same external script loads from multiple tags, creating redundant network requests.
  • jquery-dependency — Active custom HTML tags use jQuery without confirming it is available.

Common patterns

Performance findings tend to cluster in containers that were assembled incrementally over time. Each vendor tag arrives as a self-contained snippet, brings its own copy of any libraries it needs, and gets pasted into GTM without cross-referencing what's already there. After a few years of this, a container can have three tags that each independently load the same analytics helper library.

The jQuery dependency pattern is a specific variant of the same underlying habit. A developer wrote a tag using jQuery because jQuery was available on the site at the time. The site later migrated away from jQuery — or the tag got copied to a site that never had it — and the dependency is now invisible. The tag still fires; it just fails silently on any page where jQuery isn't loaded first.

The All Pages trigger pattern is usually a sign that the original tag author moved routing logic into JavaScript rather than into GTM's trigger system. This is understandable — GTM's trigger UI is less familiar than writing an if statement — but it means GTM cannot skip tag evaluation on irrelevant pages. Moving the condition into a trigger variable costs roughly the same developer time to fix and eliminates the overhead on every non-matching page load going forward.

See also

  • Health score — how findings translate to score deductions
  • Rules catalog — browse all rules across every category
  • Quality rules — adjacent category covering tag hygiene and maintenance debt

Examples

Filter to this category
curl https://developer.tagmanifest.com/v1/scan-url \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com","category":"performance"}'