agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/analytics-tracking-testing/SKILL.md

analytics-tracking-testing

Skill1 starsChanged 52 days agoMITView on GitHub

Use when validating analytics and tracking — GA4/GTM dataLayer, Segment/Amplitude/Mixpanel events, pixels (Meta, TikTok), server-side tagging, consent mode, UTM/attribution, event schema/tracking plan conformance, and data parity with the backend.

2 other projects use a version of this.

Adopted by

Most recently taken up by

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
  1. Distinctive:

    If tracking is wrong, every product decision built on it is wrong.

    line 13

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Analytics & Tracking Testing

If tracking is wrong, every product decision built on it is wrong. Treat the tracking plan as a contract and test it like an API.

1. Tracking plan (source of truth)

event name · trigger · properties (name/type/enum/required) · owner · destinations. Naming: object_action snake_case (checkout_started). Version it in git; generate JSON Schema for validation (Segment Protocols, Avo, Amplitude Data).

2. Verify in the browser

// Console: watch the dataLayer
window.dataLayer.push = new Proxy(window.dataLayer.push, { apply(t, s, a){ console.log('DL', JSON.stringify(a[0])); return Reflect.apply(t, s, a);} });
  • GTM Preview / Tag Assistant; GA4 DebugView (?debug_mode=1); Segment Debugger; Meta Pixel Helper; chrome://net-export or DevTools Network filter collect|g/collect|track.
  • Automate: Playwright intercepts requests and asserts payloads.
const hits: any[] = [];
page.on('request', r => { if (/google-analytics\.com\/g\/collect|\/v1\/track/.test(r.url())) hits.push(r.postData() ?? r.url()); });
await page.getByRole('button',{name:'Add to cart'}).click();
await expect.poll(() => hits.some(h => h.includes('add_to_cart'))).toBeTruthy();

3. What to assert

AreaChecks
FiringFires once per action (no dupes on SPA re-render/route change); not on load unless intended; fires after success not on click
PayloadNames/types match plan; currency ISO code, value numeric, items[] complete; no PII (email, phone) unless hashed & allowed
Identityuser_id set on login, cleared on logout; anonymous→known stitching; cross-domain _gl linker
Page/routeSPA virtual pageviews, correct page_location, canonical vs UTM-cluttered URL
AttributionUTM params captured, persisted across pages, not overwritten by internal links; referrer exclusions (payment gateways)
ConsentNothing fires before opt-in (EU); Consent Mode v2 defaults denied; withdrawal stops tags; CMP banner accessible
Ecommerceview_item → add_to_cart → begin_checkout → purchase funnel with same transaction_id (dedupe)
Server-sideServer events dedupe with client via event_id; PII hashing SHA-256; CAPI/Measurement Protocol response OK
PerformanceTags async, not blocking LCP; total third-party weight
Ad blockers/ITPGraceful degradation; first-party endpoint

4. Parity (weekly automated)

Compare analytics revenue/orders/signups vs backend DB for the same window. Expect small drift (ad-blockers ~5–15%); alert when > threshold or trend changes after a release.

5. Regression net

Contract test each event schema in CI (JSON Schema + example payload from E2E); block deploys that rename events or drop required props; release checklist step "tracking verified".

Related

e2e-testing, payment-ecommerce-testing, compliance-testing, seo-testing, observability-testing

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.