You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rule: analytics/duplicate-tags - the same analytics tag installed more than once on a page #1691
When the same analytics tag is loaded twice on a page, every pageview and event is counted twice. It usually happens when a tag is added in the site template and again through a tag manager or a plugin. analytics/gtm-present only reports which platforms are present, and it deduplicates that list, so a double install passes.
Proposal
A page rule, analytics/duplicate-tags, that warns when one page loads the same tag more than once:
Google Analytics 4: the same measurement ID (G-...) configured more than once.
Google Tag Manager: the same container ID (GTM-...) loaded more than once.
The other platforms analytics/gtm-present detects (Plausible, Fathom, Matomo, Segment, Mixpanel, Amplitude, Heap, Hotjar, Microsoft Clarity): the same loader with the same site or project ID included more than once.
Acceptance Criteria
A page that loads the same GA4 measurement ID twice gets a warning naming the ID and the number of times it appears.
A page that loads the same GTM container ID twice gets a warning naming the container ID.
A page that includes the same loader with the same site or project ID twice, for each of the other listed platforms, gets a warning naming the platform and the ID.
Two different IDs for the same platform on one page are not flagged.
The standard GTM pair of one script and one noscript frame for the same container counts as one install.
A GA4 loader script plus its own config call for the same ID counts as one install.
A preload or preconnect hint for a tag's host is not counted as an install.
Each platform has a fixture with a single install that passes and a double install that warns.
IDs in the finding are shown as they appear in the page. No request is made to any analytics vendor.
When the same duplicate appears on many pages, the report groups it as one issue with the affected pages listed.
The same input gives the same result on every run.
The rule has a docs page under docs/rules/analytics/ and appears in the rule catalog and counts.
Shipped in v0.0.177 via 1a9887b (fix(rules): analytics/duplicate-tags reads every vendor loader as a URL, id in any case; docs: Security rule count #1691).
Activity
feat(rules): analytics/duplicate-tags flags the same analytics tag in…
fix(rules): analytics/duplicate-tags reads every vendor loader as a U…
nc9 commentedon Nov 11, 2026
Shipped in v0.0.177 via 1a9887b (
fix(rules): analytics/duplicate-tags reads every vendor loader as a URL, id in any case; docs: Security rule count #1691).nik