Ga4 attribution
AI agent skills for operators who build systems, not just campaigns
npx -y skills add buildwitharup/cortex --skill ga4-attributionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
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".
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
6.6 KB, as published. Nobody here has run it
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=keyword
Phase 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