tag-manager
Skill0 starsChanged 48 days agoMITView on GitHub
Decide between direct gtag and Google Tag Manager, audit an existing GTM container or Google tag setup on a live site (which IDs fire, which tags scrape the DOM, duplicate configs), and set up GTM safely when it is warranted. Use for "Tag Manager", "GTM", "gắn thẻ", "Google tag", or when a site's tracking behaves inconsistently.
In this repository7 other files it gives its agents.
- ad-assetsSkill
- conversion-trackingSkill
- google-growth-journeySkill
- google-ui-automationSkill
- growth-auditSkill
- pmax-campaignSkill
- search-console-seoSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Look for duplicate configs (GA4 configured both in GTM and hard-coded → double page views) and DOM scraping (Custom JS variables that read …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tag Manager / Google tag
Choose the simplest thing that works
| Situation | Use |
| You own the code, 1–2 destinations (GA4 + Ads) | Direct gtag in the layout. Events from the server. Reviewable in git, testable. |
| Marketing needs to add pixels without deploys; many vendors | GTM, with events pushed to dataLayer by the code (not scraped). |
| No code access (hosted builder) | GTM or the builder's native Google integration. |
GTM is not "more professional"; it's another place where tracking can silently break and where nobody reviews changes. Don't add it to a codebase that already emits clean events.
Audit a live site
In a real browser (not curl — bot protection hides the tags):
- View source / DevTools → find
googletagmanager.com/gtag/js?id=…andgoogletagmanager.com/gtm.js?id=GTM-…. Note every ID. - Console → run
${CLAUDE_PLUGIN_ROOT}/scripts/check_gtag.js. It listsconfigcalls, events already pushed, and flagspage_locationvalues that carry query strings. Look for duplicate configs (GA4 configured both in GTM and hard-coded → double page views) and DOM scraping (Custom JS variables that read "Amount: …" text to build a purchase value). Replace scraping with a
dataLayer.pushfrom the server-rendered page:dataLayer.push({ event: 'purchase', ecommerce: { transaction_id: 'order-123', value: 160000, currency: 'VND', items: [/* … */] } });- Tag Assistant (tagassistant.google.com) confirms which destinations receive hits.
GTM setup, if warranted
- One container per site. Publish with a version name and notes ("GA4 purchase from dataLayer").
- Google tag (GA4) with the measurement ID; set
page_locationvia a Custom JS variable that applies the same whitelist asconversion-tracking§1 (keep gclid/utm only). - Conversion Linker tag on all pages (for Ads).
- Triggers on custom events (
purchase,sign_up), never on "Page View of /thank-you" when a server event is available. - Consent: if the site serves EU/UK users, add Consent Mode v2 defaults before any tag.
Hand-off note
Record, in the repo docs, every ID (GTM-, G-, AW-), which account owns it, and which event feeds which conversion action. The next person will otherwise re-discover it by trial.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

