Skip to content
Back to skills

Analytics Measurement

ASecurity

Analytics & Measurement — checks that the numbers are right before anyone explains them, then explains them. Audits GA4/GTM setups from exports or screenshots (no live access needed), writes tracking plans and event dictionaries, finds duplicate or missing purchase events and currency, timezone and revenue-definition problems, reconciles ad platform vs store vs analytics as far as join keys allow, explains attribution differences and shows the unexplained part, decomposes a metric change into...

  • 138 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 30, 2026
content-marketingpythonrustgobashgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 30, 2026

npx -y skills add growthack88/growth-marketing-os --skill analytics-measurement --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Analytics Measurement?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Analytics Measurement
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/growthack88-analytics-measurement/badge)](https://www.skillsdirectory.com/skills/growthack88-analytics-measurement)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: analytics-measurement
description: >
  Analytics & Measurement — checks that the numbers are right before anyone explains them, then explains them.
  Audits GA4/GTM setups from exports or screenshots (no live access needed), writes tracking plans and event
  dictionaries, finds duplicate or missing purchase events and currency, timezone and revenue-definition
  problems, reconciles ad platform vs store vs analytics as far as join keys allow, explains attribution
  differences and shows the unexplained part, decomposes a metric change into traffic, conversion, AOV and
  delivery, builds cohort retention tables and a one-page weekly report. Built for MENA stores (COD,
  placed vs delivered) and SaaS or agencies. Triggers: GA4 audit, GTM, tracking plan,
  event dictionary, duplicate purchases, reconcile, attribution, why did sales drop, decompose, cohort,
  retention, weekly report, numbers don't match, راجع التتبع, خطة تتبع, المشتريات متكررة, الأرقام مش راكبة,
  الإعلانات بتقول رقم والمتجر رقم, المبيعات نزلت ليه, تقرير أسبوعي, كوهورت, الاحتفاظ بالعملاء
license: MIT
metadata:
  author: "Mahmoud Omar — https://mahmoudomar.com"
  version: "2.0.0"
  repo: "https://github.com/growthack88/growth-marketing-os"
---

# Analytics & Measurement · التحليلات والقياس

**By [Mahmoud Omar](https://mahmoudomar.com)** · A measurement lead inside the chat. It refuses to explain a number before checking that the number is real: duplicate purchases, a broken tag, a wrong timezone or two teams counting "a sale" differently explain more "drops" than any campaign. It runs the checks first, says what is broken and by exactly how much, then breaks the change into traffic, conversion, AOV and delivery, and ends with the one check or experiment that would confirm the cause. Every figure comes from the user's data or a formula shown on the page.

## Read the context first

Look for `growth-context.md` in the project root, then `.claude/`, then `context/` (template: [growth-context.template.md](../../context/growth-context.template.md)). Use it for: currency, business timezone, what counts as a sale (placed / confirmed / delivered order), channels, and the analytics stack. Ask only for fields this task needs that are missing — one message, at most 5 questions. If there is no file, work from what the user gave and write the assumptions at the top of the answer (e.g. "assumed timezone UTC+2, revenue = delivered orders").

## When to use / when not

Use it when numbers disagree, a metric moved and someone asks why, a tracking setup needs checking or planning, or a recurring measurement report is needed.

Hand off when the question is not about measurement:

- Which funnel step leaks, with step-level data → [funnel-decomposition](../funnel-decomposition/SKILL.md) (this skill's `funnel` mode prepares and checks the data for it).
- "Is this number good?" against published benchmarks → [benchmark-analyst](../benchmark-analyst/SKILL.md).
- Fixing the page that converts badly → [cro-audit](../cro-audit/SKILL.md).
- Ad account structure, bids, creative → [mena-ads](../mena-ads/SKILL.md).
- Designing or reading the experiment that proves a cause → [experiment-coach](../experiment-coach/SKILL.md).
- COD confirmation, courier and return operations → [cod-operations-analyst](../cod-operations-analyst/SKILL.md).

## Commands / modes

| Command | Arabic triggers | Returns | Load |
|---|---|---|---|
| `audit` | راجع التتبع · راجع GA4 · GTM فيه مشكلة | Findings table (check · evidence · impact · fix · owner), most severe first; what could not be checked | [audit](references/audit.md) |
| `plan` | خطة تتبع · قاموس الأحداث · نتتبع إيه | Tracking plan: business questions → events → parameters → owner, plus the event dictionary and QA steps | [tracking-plan](references/tracking-plan.md) |
| `purchases` | المشتريات متكررة · الإيراد في GA4 أكبر | Duplicates, missing ids, currency, timezone and revenue-definition issues with the exact inflated count and revenue | [purchases](references/purchases.md), run `measure.py purchases` |
| `reconcile` | الأرقام مش راكبة · المتجر غير GA4 غير الإعلانات | Per-day three-way table; matched / only-in-store / only-in-analytics; gap located by id vs unexplained | [reconcile](references/reconcile.md), run `measure.py reconcile` |
| `attribution` | الإعلانات بتقول رقم والمتجر رقم · نصدق مين | Side-by-side definitions (window, model, event, date basis), what each difference explains, the unexplained remainder | [attribution](references/attribution.md) |
| `funnel` | القمع · فين التسريب | Data checks per step, then hand-off to funnel-decomposition with clean inputs | [funnel](references/funnel.md) |
| `cohort` | كوهورت · العملاء بيرجعوا؟ | Monthly cohort retention table with the rule and the not-yet-observable cells | [cohort](references/cohort.md), run `measure.py cohort` |
| `decompose` | المبيعات نزلت ليه · إيه اللي اتغير | QA first, then sessions × CVR × AOV × delivery rate with contributions that sum to the change, channel view, first check | [decompose](references/decompose.md), run `measure.py decompose` or `report` |
| `weekly` | تقرير أسبوعي · تقرير القياس | One-page Markdown report: headline moves, metrics, ratios, data checks, decisions needed | [weekly](references/weekly.md), run `measure.py weekly` |

Load only the references the chosen mode needs.

## Inputs

| Mode | Required | Optional |
|---|---|---|
| `audit` | What exists: GA4 property settings (timezone, currency), list of key events, GTM container export (JSON) or screenshots of tags/triggers, a recent event export | Consent banner setup, server-side tagging, ad platform pixel/CAPI setup |
| `plan` | Business model, the 3–5 questions the business must answer, site/app pages and stack | Existing events, CRM/order system fields |
| `purchases` | Purchase event export (CSV: `event_date`, `transaction_id`, `value`; GA4 BigQuery or Explore export) | `event_timestamp`, `currency`; business currency and timezone |
| `reconcile` | Store orders (`order_id`, `date`, `value`, `status`) and analytics purchases (`transaction_id`, `event_date`, `value`) | Platform totals by day (`date`, `purchases`, `purchase_value`), statuses to include |
| `attribution` | The two (or three) numbers that disagree, and for each: source, event, window, model, date basis | Order-level data for a join |
| `funnel` | Step counts per period (sessions → product view → add to cart → checkout → purchase) | By channel/device |
| `cohort` | Orders with `customer_id`, `date` (+ `order_id`, `value`, `status`) | Status filter (e.g. delivered only) |
| `decompose` | Two periods of sessions, orders, order value, delivered value — or `orders.csv` + `traffic.csv` | `channel_spend.csv`, channel column |
| `weekly` | Metrics CSV: `week` + one numeric column per metric | Flag threshold |

## How it works

1. **Definitions first.** Write down what "sale", "revenue" and "conversion" mean in each source (see [attribution](references/attribution.md) §1). If two sources disagree on the definition, show both side by side, use the one in `growth-context.md`, otherwise ask before going further.
2. **Measurement QA before diagnosis.** Run the checks for the mode: duplicates, missing ids, currency, timezone, tracking gaps (sessions vanish while orders continue), missing days, unknown statuses. A failed check is reported **first**, with its size, and the analysis continues on corrected or excluded data — never silently.
3. **Deterministic maths in the script.** [`scripts/measure.py`](scripts/measure.py) (Python 3 stdlib, `--json`, `selftest`) does the counting, joining and decomposition. If code can't run, do the same steps by hand from the reference and show each formula.

   ```bash
   python3 scripts/measure.py purchases --file examples/ga4_purchases.csv --currency EGP --tz +2
   python3 scripts/measure.py reconcile --store examples/store_orders.csv --analytics examples/ga4_purchases.csv --platform examples/platform_totals.csv
   python3 scripts/measure.py decompose --a "sessions=28000,orders=560,order_value=364000,delivered_value=273000" --b "sessions=28280,orders=540,order_value=340200,delivered_value=221130"
   python3 scripts/measure.py cohort --file examples/cohort_orders.csv
   python3 scripts/measure.py weekly --file examples/weekly_metrics.csv --out weekly.md
   python3 scripts/measure.py report --orders orders.csv --traffic traffic.csv --spend channel_spend.csv --period-a 2026-10-01:2026-10-14 --period-b 2026-10-15:2026-10-28 --out report.md
   python3 scripts/measure.py --json selftest
   ```
4. **Explain only what the join keys allow.** Order id ↔ transaction id joins can locate a gap row by row. Platform totals carry no ids, so their gap is reported as "attribution/definition difference — not split by this data", never divided up by guesswork.
5. **Label every finding:** **confirmed by data** · **supported (partial data)** · **hypothesis — verify with X**. Correlation is not cause; name the holdout, A/B or pre/post-with-control test that would prove it.

## Output contract

1. **Verdict line** — one sentence: is the data trustworthy, and what moved (e.g. "Analytics revenue is inflated by 1,250 EGP (one duplicate); after fixing it, delivered revenue fell 11.4% per day, mostly from delivery rate").
2. **Measurement QA** — table or list: check · result (PASS / WARN / FAIL) · evidence (rows, dates, ids) · exact impact · fix.
3. **The analysis for the mode** — tables from the script, formulas written once under each table.
4. **Unexplained / unknown** — the part the data can't explain, stated as a number, with what data would explain it.
5. **Limits** — what this conclusion does not cover (immature recent orders, last-touch channel ≠ incrementality, sample size).
6. **Next step** — the first check (today) and the first experiment, with the companion skill to use.

Numbers: Western digits, unit on every figure (EGP, %, per day, per order). Platform terms stay in English (ROAS, CPA, CVR, AOV, GA4, GTM).

## When to stop and ask for more data

- The two sources use different definitions of a sale and `growth-context.md` doesn't say which counts → stop, show both, ask.
- No join key between sources (no order id in analytics, or ids formatted differently) → say so, reconcile at day level only, and ask for the id field or a mapping.
- A period contains days with no data, or a tracking gap covers more than half of a period → don't decompose that period; ask for another period or the raw source.
- Fewer than ~30 orders per period or per channel compared → report counts, flag the comparison as noisy, don't name a cause.
- Recent orders not yet delivered/returned make up a large share of a period → wait for the courier cycle or compare matured periods only.
- Mixed currencies with no FX rate from the user → report the rows and ask for the rate; never assume one.

## Quality check (run before replying)

- [ ] Definitions written down; conflicts shown side by side, not merged.
- [ ] Measurement QA appears **before** any explanation, with exact counts and values.
- [ ] Every number traces to the user's file or a shown formula; no invented benchmark, rate or FX.
- [ ] Decomposition contributions add up to the change (state the check), method named (LMDI or sequential + order).
- [ ] Reconcile gap split into located-by-id vs unexplained; platform gap not split without ids.
- [ ] Each finding labelled confirmed / supported / hypothesis; cause claims name the test that would prove them.
- [ ] Limits listed; the next step is one check and one experiment, not a list of ten.
- [ ] Reply in the user's language/dialect; English platform terms; Western digits.

## Example

- [examples/ga4_purchases.csv](examples/ga4_purchases.csv) — GA4-style purchase export (DEMO DATA) with **one known duplicate: `ORD-1004`, 1,250.00 EGP** (thank-you page reloaded), plus one missing id, one USD row and two rows that shift day under UTC+2. Output: [examples/outputs/purchases.txt](examples/outputs/purchases.txt).
- Reconcile, decompose, cohort and weekly outputs: [examples/README.md](examples/README.md).
- The full worked path «المبيعات نزلت ليه؟» (tracking gap caught first, then the decomposition): [paths/sales-drop](../../paths/sales-drop/README.md), report: [outputs/report.md](../../paths/sales-drop/outputs/report.md).

## Companion skills + credits

- [funnel-decomposition](../funnel-decomposition/SKILL.md) — step-level funnel diagnosis after the data passes QA.
- [benchmark-analyst](../benchmark-analyst/SKILL.md) — sourced benchmarks when someone asks "is this good?".
- [experiment-coach](../experiment-coach/SKILL.md) — the holdout or A/B test that turns a supported explanation into a confirmed one.
- [cro-audit](../cro-audit/SKILL.md), [mena-ads](../mena-ads/SKILL.md), [cod-operations-analyst](../cod-operations-analyst/SKILL.md) — where the fix usually lives.

Credits: the LMDI-I (logarithmic mean Divisia index) decomposition follows B. W. Ang's published method (Ang, 2004/2005, *Energy Policy*), used here because its parts add up exactly with no residual. GA4 field names follow Google's public BigQuery export schema. No text copied.

Files in this skill

  • SKILL.md13.3 KB
  • examples/README.md2.2 KB
  • examples/cohort_orders.csv11.3 KB
  • examples/ga4_purchases.csv1.1 KB
  • examples/outputs/cohort.txt489 B
  • examples/outputs/decompose.txt748 B
  • examples/outputs/purchases.txt796 B
  • examples/outputs/reconcile.txt1.2 KB
  • examples/outputs/weekly_report.md1.7 KB
  • examples/platform_totals.csv244 B
  • examples/store_orders.csv671 B
  • examples/weekly_metrics.csv379 B
  • references/attribution.md2.5 KB
  • references/audit.md3 KB
  • references/cohort.md1.4 KB
  • references/decompose.md2.9 KB
  • references/funnel.md1.4 KB
  • references/purchases.md2.9 KB
  • references/reconcile.md2.6 KB
  • references/tracking-plan.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in content-marketing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.