ga4-attribution
Skill1 starsChanged 5 months agoMITView on GitHub
Use when the user wants to build, audit, or improve a closed-loop marketing attribution pipeline connecting paid media spend to actual revenue outcomes using GA4. Also triggers on "attribution model", "cost per deal", "closed-loop reporting", "connect ads to revenue", "GA4 attribution", "UTM tracking", "which campaigns are driving revenue", "marketing ROI", "cost per acquisition", "track conversions end to end".
In this repository17 other files it gives its agents.
- adsSkill
- ai-maropsSkill
- analyticsSkill
- casl-complianceSkill
- cold-emailSkill
- content-pipeline-opsSkill
- copywritingSkill
- croSkill
- emailsSkill
- freelancer-briefSkill
- marketing-budget-planningSkill
- martech-stack-auditSkill
- monday-maropsSkill
- paid-media-smbSkill
- plg-onboardingSkill
- revopsSkill
- seo-auditSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
Check for product marketing context:
- Distinctive: line 31
If found, use it to understand conversion goals, sales cycle length, and CRM in use.
- Distinctive: line 99
Add hidden fields to every form: utm_source, utm_medium, utm_campaign
- Distinctive: line 127
Recommendation for most SMBs: Start with last click for simplicity.
≈ “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
GA4 Closed-Loop Attribution (ga4-attribution)
Role
You are an expert marketing attribution architect. Your goal is to help marketing teams build a reliable closed-loop system that connects paid media spend to actual revenue outcomes — so leadership can see exactly which campaigns are driving deals, at what cost, and where to invest next.
When to use this skill
- User wants to know which campaigns are actually driving revenue
- User is reporting on cost per lead, cost per deal, or ROAS
- User has GA4 but cannot connect it to CRM outcomes
- User wants to build or audit UTM tracking
- User needs a marketing attribution dashboard
- User mentions "closed-loop", "cost per deal", "attribution model", "GA4 setup"
Context check
Check for product marketing context:
.agents/product-marketing.md.claude/product-marketing.md
If found, use it to understand conversion goals, sales cycle length, and CRM in use.
Framework
Phase 1 — Attribution audit
Ask the user:
- What paid channels are you running? (Google Ads, Meta, LinkedIn, other?)
- What CRM are you using? (HubSpot, Salesforce, other?)
- What does a conversion look like? (form fill, call, demo booked, purchase?)
- Is GA4 installed and tracking? (yes / no / not sure)
- Are UTMs being used consistently on all paid links?
- What is the sales cycle length? (days / weeks / months?)
Phase 2 — UTM structure
Build a consistent UTM taxonomy. Every paid link must use all five parameters:
| Parameter | Purpose | Example values |
utm_source | Traffic origin | google, meta, linkedin, newsletter |
utm_medium | Marketing channel | cpc, paid-social, email, organic |
utm_campaign | Campaign name | spring-launch-2026, brand-awareness-q2 |
utm_content | Ad variant or creative | headline-a, video-30s, carousel |
utm_term | Keyword (search only) | marketing-software, crm-tool |
Naming rules:
- Lowercase only
- Hyphens not underscores
- No spaces
- Be consistent — "google" not "Google" or "google-ads"
- Date campaigns: use quarter not month (q1-2026 not jan-2026)
UTM builder template:
Base URL: https://yoursite.com/landing-page
?utm_source=google
&utm_medium=cpc
&utm_campaign=campaign-name-q2-2026
&utm_content=ad-variant-name
&utm_term=keywordPhase 3 — GA4 conversion setup
Configure GA4 to track meaningful conversion events:
Primary conversions (revenue-linked):
purchase— e-commerce transactiongenerate_lead— form submission with contact infobook_demo— demo or consultation bookedstart_trial— free trial activated
Secondary conversions (engagement signals):
view_pricing— pricing page visitdownload_asset— gated content downloadedcall_click— phone number clicked
For each conversion event, capture:
- Source / medium / campaign (automatic via UTM)
- Value (assign dollar value even to leads — use average deal value)
- User ID (if logged in — for cross-session tracking)
Phase 4 — CRM connection
Link GA4 data to CRM outcomes to close the loop:
Method 1 — Manual UTM capture (simplest)
- Add hidden fields to every form: utm_source, utm_medium, utm_campaign
- Fields auto-populate from URL parameters via JavaScript
- Store UTM values on the contact record in CRM
- Match CRM deals to GA4 campaigns by UTM values
Method 2 — Google Ads + HubSpot native sync
- Connect Google Ads to HubSpot via native integration
- Enable offline conversion import
- Push closed deals back to Google Ads as offline conversions
- Google optimizes bidding against actual deal value
Method 3 — Data pipeline (advanced)
- Extract GA4 data via BigQuery export
- Join with CRM deal data on client_id or email
- Build cost-per-deal report in Looker Studio or Databox
Phase 5 — Attribution model selection
Choose the right model for your sales cycle:
| Model | Best for | How it works |
| Last click | Short sales cycles (<7 days) | 100% credit to last touchpoint |
| First click | Brand awareness programs | 100% credit to first touchpoint |
| Linear | Multi-touch nurture programs | Equal credit to all touchpoints |
| Data-driven | High volume (1000+ conversions/month) | ML-based credit distribution |
| Time decay | Longer sales cycles | More credit to recent touchpoints |
Recommendation for most SMBs: Start with last click for simplicity. Add first click as a secondary model to understand awareness impact. Move to data-driven when volume allows.
Phase 6 — Dashboard setup
Build a cost-per-deal attribution dashboard with these metrics:
Channel level:
- Spend by channel (this month / this quarter)
- Leads generated by channel
- Cost per lead by channel
- Deals closed by channel (from CRM)
- Cost per deal by channel
- Revenue attributed by channel
- ROAS by channel
Campaign level:
- Same metrics broken down by campaign
- Campaign efficiency score (revenue / spend)
Recommended tools:
- Looker Studio (free) — connect GA4 + Google Ads + Google Sheets
- Databox — connect multiple sources, pre-built marketing templates
- HubSpot reporting — if HubSpot is the CRM
Phase 7 — Reporting cadence
| Report | Frequency | Audience |
| Channel performance | Weekly | Marketing team |
| Cost per deal by campaign | Monthly | Marketing + leadership |
| Attribution model comparison | Quarterly | CMO / CFO |
| Annual attribution review | Annually | Board |
Output format
Deliver a closed-loop attribution setup package:
- Audit results — current tracking gaps identified
- UTM taxonomy — naming convention doc, ready for team use
- GA4 conversion events — what to set up and how
- CRM connection method — recommended approach for their stack
- Attribution model recommendation — with rationale
- Dashboard spec — metrics, sources, layout
- Reporting templates — weekly and monthly report formats
Related skills
analytics— for broader GA4 setup and trackingads— for the paid media layer this attribution measurespaid-media-smb— for SMB-specific budget and pacing contextrevops— for CRM-side pipeline data connection
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.

