Repository navigation
public: flag Google tags gone from or new on a home page - #36
Merged
Merged
Conversation
The prober records the GTM and GA4 IDs each home page names; the check compares them with data-audit.json's new tags (by home URL without the scheme). A declared tag gone or an undeclared one is a review flag; a site with tags and no declaration is flagged once so it gets declared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking breaks silently: a deploy drops the GTM snippet, a consent-tool update stops printing it, someone swaps the container. This adds a check against the IDs each site should have.
What it does
web): records the Google tag IDs each home page names, asPublicSite.Tags. It reads the page it already fetches, so no extra requests.GTM-…anywhere in the page. A consent tool's parkedtext/plaincopy and the noscript fallback count: the tag is still the site's, consent or not.G-…only where gtag loads (?id=G-…) or configures ('config', 'G-…') one, since a bareG-…can be a product code on a shop's front page.nilwhen the landing page wasn't read,[]when it names none, so a 503 doesn't look like tracking lost.data-audit.jsongetstags, keyed by home URL without the scheme likepublic_roles:{"client.example": ["GTM-ABC1234"], "client.example/sv": []}.public), all at review level:tag-missing:<host>:<id>: a declared tag is gone (tracking lost?)tag-new:<host>:<id>: a tag that isn't declared (a changed or added container?)tags-undeclared:<host>:<hash>: a site with tags and no declaration, flagged once so every site gets declaredThe audited sites' declarations follow as one PR per site repo.
Tests
go test ./...,go vet,gofmt -lclean. New:TestTags(parked copy, noscript, gtag load/config, a product code ignored,[]vs nil) andTestPublicTags(missing, new, undeclared, a subdirectory site, an unread page, no repo).🤖 Generated with Claude Code