Loam & Ledger (DTC home goods, Shopify, GA4 via GTM, Meta/Google/TikTok/Klaviyo) has engaged you to audit their tracking before Q4 budgets unlock. You are supplied their documented measurement standards, the full list of live campaign links, a summary of the GTM container, and a memo of unexplained symptoms.
Deliver the audit report. For every defect you find: name exactly where it is (which link, tag, trigger, or setting), why it is wrong (against the standards or against correct measurement practice), the measurement or compliance impact — connecting it to the reported symptoms where the evidence supports it — and the concrete fix. Order findings by impact. Close with a short list of what you checked and found clean, so the team knows what they can trust.
Flag only real defects: do not pad the report by flagging conforming items. This is an audit document for internal review; change nothing and fetch nothing external.
---
## Supplied source: tracking_standards.md
# Loam & Ledger — Measurement Standards (v3, agreed 2026-01)
These conventions are the contract between marketing, the web team, and
finance. Every live link and every tag change is supposed to conform.
## UTM conventions
- All UTM parameter values are **lowercase**, always.
- `utm_source` is the platform: `google`, `meta`, `klaviyo`, `tiktok`,
`pinterest`, or the partner site's domain for affiliates.
(Historical note: we standardized on `meta` — not `facebook` — in v2.)
- `utm_medium` is one of exactly: `cpc`, `paidsocial`, `email`, `affiliate`,
`organicsocial`.
- `utm_campaign` format: `<year>q<quarter>-<line>-<goal>`, hyphen-separated,
no spaces, e.g. `2026q3-linen-prospecting`. Campaigns run for the `ca.`
storefront append the market suffix `-ca` (e.g.
`2026q3-linen-prospecting-ca`).
- Every parameter appears at most once per URL.
- All destination URLs are `https://` on `www.loamandledger.com` (or the
`ca.` storefront).
## GA4 / GTM conventions
- GA4 event names are `snake_case` (`begin_checkout`, `add_to_cart`).
- Exactly **one** `purchase` event fires per order, on the order confirmation
page only, carrying `transaction_id`, `value`, `currency`, and `items`.
- `currency` reflects the order's actual currency. The `ca.` storefront
transacts in CAD.
- Ecommerce values are order totals net of tax and shipping.
## Consent (Consent Mode v2)
- Defaults for visitors in the EEA/UK: `analytics_storage: denied` and
`ad_storage: denied` until the banner grants them.
- Defaults elsewhere: both granted.
- Tags must respect consent state; no consent-exempt duplicates.
---
## Supplied source: active_links.csv
channel,destination_url,notes
google-search,https://www.loamandledger.com/collections/linen?utm_source=google&utm_medium=CPC&utm_campaign=2026q3-linen-prospecting,brand + non-brand search
google-search,https://www.loamandledger.com/collections/ceramics?utm_source=google&utm_medium=CPC&utm_campaign=2026q3-ceramics-prospecting,non-brand search
google-pmax,https://www.loamandledger.com/collections/new?utm_source=google&utm_medium=CPC&utm_campaign=2026q3-newin-pmax,performance max
google-brand,https://www.loamandledger.com/?utm_source=google&utm_medium=cpc&utm_campaign=2026q3-brand-defense,brand exact
meta-prospecting,https://www.loamandledger.com/collections/linen?utm_source=facebook&utm_medium=paidsocial&utm_campaign=2026q3-linen-prospecting,advantage+ audience
meta-prospecting,https://www.loamandledger.com/collections/table?utm_source=meta&utm_medium=paidsocial&utm_campaign=2026q3-table-prospecting,interest stack
meta-retargeting,https://www.loamandledger.com/collections/bestsellers?utm_source=facebook&utm_medium=paidsocial&utm_campaign=2026q3-bestsellers-retargeting,site visitors 30d
meta-retargeting,https://www.loamandledger.com/cart?utm_source=meta&utm_medium=paidsocial&utm_campaign=2026q3-cart-recovery&utm_campaign=cart_recovery,cart abandoners 7d
meta-summer,https://www.loamandledger.com/collections/summer?utm_source=meta&utm_medium=paidsocial&utm_campaign=2026q3 summer sale,seasonal push landing
tiktok-prospecting,https://www.loamandledger.com/collections/linen?utm_source=tiktok&utm_medium=paidsocial&utm_campaign=2026q3-linen-spark,spark ads
tiktok-prospecting,https://www.loamandledger.com/collections/ceramics?utm_source=tiktok&utm_medium=paidsocial&utm_campaign=2026q3-ceramics-spark,spark ads
klaviyo-newsletter,http://www.loamandledger.com/collections/new?utm_source=klaviyo&utm_medium=email&utm_campaign=2026q3-weekly-newsletter,weekly send
klaviyo-newsletter,http://www.loamandledger.com/collections/bestsellers?utm_source=klaviyo&utm_medium=email&utm_campaign=2026q3-weekly-newsletter,weekly send alt hero
klaviyo-welcome,https://www.loamandledger.com/collections/starter?utm_medium=email&utm_campaign=2026q3-welcome-flow,welcome series step 2
klaviyo-winback,https://www.loamandledger.com/collections/new?utm_source=klaviyo&utm_medium=email&utm_campaign=2026q3-winback-flow,lapsed 120d
pinterest-prospecting,https://www.loamandledger.com/collections/table?utm_source=pinterest&utm_medium=paidsocial&utm_campaign=2026q3-table-pins,standard pins
affiliate-domesticnotes,https://www.loamandledger.com/collections/linen?utm_source=domesticnotes.com&utm_medium=affiliate&utm_campaign=2026q3-linen-roundup,editorial roundup
affiliate-hearthreview,https://www.loamandledger.com/collections/ceramics?utm_source=hearthreview.com&utm_medium=affiliate&utm_campaign=2026q3-ceramics-review,review placement
ca-google-search,https://ca.loamandledger.com/collections/linen?utm_source=google&utm_medium=cpc&utm_campaign=2026q3-linen-prospecting-ca,canadian storefront
ca-meta-prospecting,https://ca.loamandledger.com/collections/linen?utm_source=meta&utm_medium=paidsocial&utm_campaign=2026q3-linen-prospecting-ca,canadian storefront
organic-instagram,https://www.loamandledger.com/collections/new?utm_source=instagram&utm_medium=organicsocial&utm_campaign=2026q3-ig-bio,link in bio
organic-pinterest,https://www.loamandledger.com/collections/table?utm_source=pinterest&utm_medium=organicsocial&utm_campaign=2026q3-boards,board links
---
## Supplied source: gtm_ga4_setup.md
# GTM container `GTM-K4WPD2` — current configuration summary
Exported from the container as of 2026-08-20. One web container serves both
`www.loamandledger.com` and `ca.loamandledger.com`.
## Tags
**1. GA4 Configuration — `G-8B21XQ4`**
- Trigger: Initialization — All Pages
- Fields: `send_page_view: true`
- Notes: none
**2. GA4 Event — `purchase` (confirmation page)**
- Trigger: Page View where Page Path matches RegEx `^/order-confirmation`
- Parameters: `value: {{DLV - order_total}}`, `currency: "USD"`,
`items: {{DLV - items}}`
- Notes: order_total is net of tax/shipping per finance's request
**3. GA4 Event — `purchase` (checkout button)**
- Trigger: Click — All Elements, matching CSS selector `#place-order-btn`
- Parameters: `value: {{DLV - order_total}}`, `currency: "USD"`
- Notes: added 2026-06 "as a backup while debugging Safari losses" — still live
**4. GA4 Event — `Add to Cart`**
- Trigger: Custom Event `add_to_cart_clicked` (from the theme)
- Parameters: `items: {{DLV - items}}`, `value: {{DLV - line_value}}`
- Notes: renamed from `add_to_cart` during the theme migration "for readability"
**5. GA4 Event — `begin_checkout`**
- Trigger: Page View where Page Path equals `/checkout`
- Parameters: `value: {{DLV - cart_total}}`, `currency: {{DLV - currency}}`, `items: {{DLV - items}}`
- Notes: none
**6. Meta Pixel — base + purchase**
- Base code: All Pages. Purchase event: same RegEx trigger as tag 2.
- Purchase parameters: `value: {{DLV - order_total}}`, `currency: "USD"`
## Consent initialization (Consent Mode v2)
Set via a consent-initialization tag, before all others:
| Region | analytics_storage | ad_storage |
|---|---|---|
| Default (everywhere) | `granted` | `granted` |
| EEA + UK | `granted` | `denied` |
The cookie banner (Cookiebot) updates both to `granted` on accept.
## Site structure notes (from the web team)
- Order confirmation renders at `/order-confirmation` once payment settles.
- If payment is still processing (common for Interac and some PayPal flows),
the buyer first lands on `/order-confirmation-pending`, which reloads into
`/order-confirmation` when the payment settles — or into `/payment-failed`.
- The `ca.` storefront shares the same theme, templates, and container; carts
and orders there are in CAD.
---
## Supplied source: analytics_notes.md
# Symptoms we can't explain — running memo (head of growth, 2026-08-18)
Collected ahead of the Q4 scale-up. These are observations, not diagnoses.
- **Purchase counts disagree everywhere.** Last full week: Shopify says 284
orders, GA4 reports 512 purchases, Meta Ads Manager claims 205. GA4 being
~80% above Shopify is new since early June.
- **GA4 shows purchases on days with payment incidents.** On 2026-08-04 the
payment provider had an outage window; Shopify shows a dip, GA4 barely does.
Finance also notes GA4 "revenue" ran ahead of settled revenue that week.
- **Email looks broken in GA4.** Klaviyo says the weekly newsletter drives
solid clicks, but GA4 session acquisition shows almost none of it — the
sessions appear under Direct. Flows (welcome, winback) attribute fine.
- **Canadian revenue looks inflated.** Finance says GA4's CAD-storefront
revenue reads roughly a third higher than settled CAD revenue converted at
book rates. US-storefront revenue reconciles fine.
- **Paid search splits oddly.** GA4 shows two separate row groups for what
should be one Google Ads channel; the media buyer swears nothing changed in
the account.
- **Add-to-cart reporting went quiet.** The add-to-cart exploration the CRO
agency built in May shows near-zero events since the theme migration, but
the site converts normally.
- **Legal flagged us.** Outside counsel's privacy review says our analytics
cookies are being set for EU visitors before any banner interaction. We told
them we run Consent Mode; they stand by the finding.
- **Cart recovery reporting is unreadable.** The cart-recovery campaign shows
up under two different campaign names in GA4 depending on the report.
Deliverable we asked for: a full audit of links + container before Q4 budgets
unlock. Please state what you checked and found clean, too — we need to know
what's trustworthy, not just what's broken.
---
## Skill guidance you should follow
---
name: analytics
description: "Set up or audit tracking — GA4, GTM, Mixpanel, Segment; tracking plans, event naming, UTM conventions, conversion and attribution debugging. Rate metrics divide matching closed windows — never full-period spend by partial-period results."
metadata:
version: 2.2.0
---
# Analytics Tracking
You are an expert in analytics implementation and measurement. Your goal is to help set up tracking that provides actionable insights for marketing and product decisions.
## Initial Assessment
**Check for product marketing context first:**
If `.agents/product-marketing.md` exists (or `.claude/product-marketing.md`, or the legacy `product-marketing-context.md` filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.
**Apply the project's brand:**
If `BRAND.md` exists, read it before asking questions and apply it to everything you produce — its voice, messaging, and audience for anything written, and its colors, typography, and logo for anything visual. Never ask for a brand fact it already answers. If it lacks something you need, name the missing fact instead of inventing one or quietly falling back to a generic default.
Before implementing tracking, understand:
1. **Business Context** - What decisions will this data inform? What are key conversions?
2. **Current State** - What tracking exists? What tools are in use?
3. **Technical Context** - What's the tech stack? Any privacy/compliance requirements?
---
## Core Principles
### 1. Track for Decisions, Not Data
- Every event should inform a decision
- Avoid vanity metrics
- Quality > quantity of events
### 2. Start with the Questions
- What do you need to know?
- What actions will you take based on this data?
- Work backwards to what you need to track
### 3. Name Things Consistently
- Naming conventions matter
- Establish patterns before implementing
- Document everything
### 4. Maintain Data Quality
- Validate implementation
- Monitor for issues
- Clean data > more data
### 5. Compute, Don't Eyeball
- Derive every total, rate, and delta from row-level data with a script or
spreadsheet — never by scanning rows and summing mentally. One silently
dropped row corrupts every figure downstream of it.
- Cross-check each headline figure a second, independent way (a
reconciliation total, a recomputation from a different grouping) before
reporting it, and chase any mismatch to the exact row.
- When a claim is about one segment — a single campaign, ad set, channel, or
week — report that segment's own numbers. Never fold it into a neighboring
group and let the group's total speak for it.
### 6. Match Observation Windows
- A rate or efficiency metric divides a numerator and denominator that cover
the same closed observation window. Never divide a full period's spend by a
partial period's conversions or revenue — restate both over the weeks that
actually have data, and say which weeks those are.
- Cohort rates use only cohorts whose observation window has ended. A trial
or signup still inside its window is pending, not failed — exclude it from
the denominator and label it as pending rather than counting it against
the rate.
### 7. Recommend Against the Stated Goal
- Analysis ends in a recommendation, and the recommendation must be argued
from the goal the brief states — the launch target, audience, revenue, or
positioning objective — not only from what is operationally easiest.
Name which stated goal each option serves and what it trades away.
---
## Tracking Plan Framework
### Structure
```
Event Name | Category | Properties | Trigger | Notes
---------- | -------- | ---------- | ------- | -----
```
### Event Types
| Type | Examples |
|------|----------|
| Pageviews | Automatic, enhanced with metadata |
| User Actions | Button clicks, form submissions, feature usage |
| System Events | Signup completed, purchase, subscription changed |
| Custom Conversions | Goal completions, funnel stages |
**For comprehensive event lists**: See [references/event-library.md](references/event-library.md)
---
## Event Naming Conventions
### Recommended Format: Object-Action
```
signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completed
```
### Best Practices
- Lowercase with underscores
- Be specific: `cta_hero_clicked` vs. `button_clicked`
- Include context in properties, not event name
- Avoid spaces and special characters
- Document decisions
---
## Essential Events
### Marketing Site
| Event | Properties |
|-------|------------|
| cta_clicked | button_text, location |
| form_submitted | form_type |
| signup_completed | method, source |
| demo_requested | - |
### Product/App
| Event | Properties |
|-------|------------|
| onboarding_step_completed | step_number, step_name |
| feature_used | feature_name |
| purchase_completed | plan, value |
| subscription_cancelled | reason |
**For full event library by business type**: See [references/event-library.md](references/event-library.md)
---
## Event Properties
### Standard Properties
| Category | Properties |
|----------|------------|
| Page | page_title, page_location, page_referrer |
| User | user_id, user_type, account_id, plan_type |
| Campaign | source, medium, campaign, content, term |
| Product | product_id, product_name, category, price |
### Best Practices
- Use consistent property names
- Include relevant context
- Don't duplicate automatic properties
- Avoid PII in properties
---
## GA4 Implementation
### Quick Setup
1. Create GA4 property and data stream
2. Install gtag.js or GTM
3. Enable enhanced measurement
4. Configure custom events
5. Mark conversions in Admin
### Custom Event Example
```javascript
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});
```
**For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md)
---
## Google Tag Manager
### Container Structure
| Component | Purpose |
|-----------|---------|
| Tags | Code that executes (GA4, pixels) |
| Triggers | When tags fire (page view, click) |
| Variables | Dynamic values (click text, data layer) |
### Data Layer Pattern
```javascript
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});
```
**For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md)
---
## UTM Parameter Strategy
### Standard Parameters
| Parameter | Purpose | Example |
|-----------|---------|---------|
| utm_source | Traffic source | google, newsletter |
| utm_medium | Marketing medium | cpc, email, social |
| utm_campaign | Campaign name | spring_sale |
| utm_content | Differentiate versions | hero_cta |
| utm_term | Paid search keywords | running+shoes |
### Naming Conventions
- Lowercase everything
- Use underscores or hyphens consistently
- Be specific but concise: `blog_footer_cta`, not `cta1`
- Document all UTMs in a spreadsheet
---
## Debugging and Validation
### Testing Tools
| Tool | Use For |
|------|---------|
| GA4 DebugView | Real-time event monitoring |
| GTM Preview Mode | Test triggers before publish |
| Browser Extensions | Tag Assistant, dataLayer Inspector |
### Validation Checklist
- [ ] Events firing on correct triggers
- [ ] Property values populating correctly
- [ ] No duplicate events
- [ ] Works across browsers and mobile
- [ ] Conversions recorded correctly
- [ ] No PII leaking
### Common Issues
| Issue | Check |
|-------|-------|
| Events not firing | Trigger config, GTM loaded |
| Wrong values | Variable path, data layer structure |
| Duplicate events | Multiple containers, trigger firing twice |
---
## Privacy and Compliance
### Considerations
- Cookie consent required in EU/UK/CA
- No PII in analytics properties
- Data retention settings
- User deletion capabilities
### Implementation
- Use consent mode (wait for consent)
- IP anonymization
- Only collect what you need
- Integrate with consent management platform
---
## Output Format
### Tracking Plan Document
```markdown
# [Site/Product] Tracking Plan
## Overview
- Tools: GA4, GTM
- Last updated: [Date]
## Events
| Event Name | Description | Properties | Trigger |
|------------|-------------|------------|---------|
| signup_completed | User completes signup | method, plan | Success page |
## Custom Dimensions
| Name | Scope | Parameter |
|------|-------|-----------|
| user_type | User | user_type |
## Conversions
| Conversion | Event | Counting |
|------------|-------|----------|
| Signup | signup_completed | Once per session |
```
---
## Task-Specific Questions
1. What tools are you using (GA4, Mixpanel, etc.)?
2. What key actions do you want to track?
3. What decisions will this data inform?
4. Who implements - dev team or marketing?
5. Are there privacy/consent requirements?
6. What's already tracked?
---
## Tool Integrations
For implementation, see the [tools registry](../../tools/REGISTRY.md). Key analytics tools:
| Tool | Best For | MCP | Guide |
|------|----------|:---:|-------|
| **GA4** | Web analytics, Google ecosystem | ✓ | [ga4.md](../../tools/integrations/ga4.md) |
| **Mixpanel** | Product analytics, event tracking | - | [mixpanel.md](../../tools/integrations/mixpanel.md) |
| **Amplitude** | Product analytics, cohort analysis | - | [amplitude.md](../../tools/integrations/amplitude.md) |
| **PostHog** | Open-source analytics, session replay | - | [posthog.md](../../tools/integrations/posthog.md) |
| **Segment** | Customer data platform, routing | - | [segment.md](../../tools/integrations/segment.md) |
---
## Related Skills
- **ab-testing**: For experiment tracking
- **seo-audit**: For organic traffic analysis
- **cro**: For conversion optimization (uses this data)
- **revops**: For pipeline metrics, CRM tracking, and revenue attribution