ad-measurement-tracking

A guide to measuring advertising results across platforms such as Google, Meta, and TikTok. It covers website events, conversion tracking, consent, attribution, and matching browser and server records without counting the same conversion twice.

In plain words
What is it for?
Use it to plan GA4 events, advertising pixels and server-side signals, UTM naming, consent handling, attribution, and cross-platform deduplication.
Why use it?
It helps create consistent conversion data so advertising platforms can optimize bids and reports can be compared. It also addresses privacy requirements and the fact that each platform may claim credit for the same sale.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/squadcodercom/squadcoder/ad-measurement-tracking
Any agent
npx skills add squadcodercom/squadcoder --skill ad-measurement-tracking
Clone the repo
git clone --depth 1 https://github.com/squadcodercom/squadcoder

Made for: Claude Code, Codex.

Per session 195 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,845 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00195 $0.03845
Opus 5 $0.00097 $0.01922
Sonnet 5 $0.00039 $0.00769
Haiku 4.5 $0.00019 $0.00384

Measured 2d ago against content hash 1a3bfb2e655b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ad-measurement-tracking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.squadcoder/skills/ad-measurement-tracking/SKILL.md · 259 lines

How it starts

The opening of the file, as written. The whole thing — 259 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ad Measurement & Conversion Tracking (Cross-Platform)

The measurement layer is the foundation under every paid channel. If tracking is wrong, every bid strategy, budget decision, and creative test downstream is wrong too. This skill is the shared backbone the platform skills (Meta, Google, TikTok, etc.) reference for "how do we count a conversion and feed it back to the algorithm."

Golden rule: measure once, define events consistently across all platforms, send server-side where possible, dedupe so you never double-count, and respect consent. Get this right before scaling spend.


1. Measurement architecture (the mental model)

Three layers, in this order:

  1. Source of truth — GA4 (+ optionally a warehouse/BigQuery export) and your backend/CRM. This is where business conversions live, immune to any single ad platform's self-attribution.
  2. Ad-platform signal layer — each platform's pixel + server-side API (Meta Pixel + CAPI, Google tag + Enhanced Conversions, TikTok Pixel + Events API). These feed the bidding algorithms. They will over-report because every platform claims credit.
  3. Tag delivery layer — Google Tag Manager (web container) and ideally server-side GTM (sGTM) as a single first-party endpoint that fans out to all platforms. This is where consent, hashing, and deduplication are enforced once.

Decision order for any new conversion: define the event → fire client-side (pixel) → mirror server-side (CAPI/Events API/server-side GTM) with a shared event_id → verify dedup → confirm in GA4 + platform Events Manager.


2. GA4 events & conversions

GA4 is event-based — everything is an event with parameters. Structure:

  • Automatically collected: page_view, session_start, first_visit, scroll, click (outbound), file_download, video_* (Enhanced Measurement — turn on in the data stream).
  • Recommended events — use Google's reserved names so GA4/Ads can interpret them: view_item, add_to_cart, begin_checkout, add_payment_info, purchase, generate_lead, sign_up, login, search. Don't invent names where a recommended one exists.
  • purchase requires currency + value + transaction_id (dedupe key) + items[].
  • Custom events — only for genuinely custom actions; register custom dimensions/metrics for any parameter you want to report on (GA4 ignores unregistered params in reports).

Read the full file on GitHub · 259 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 259 lines · 195 tokens per session scan A 1a3bfb2e655b

Subscribe to this mod's changes

ad-measurement-tracking is a skill published in the GitHub repository squadcodercom/squadcoder (11 stars, last pushed 2mo ago), licensed MIT. It adds 195 tokens to every session and 3,845 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.