agentsclimarketplace

Ga4 attribution

Skill buildwitharup/cortex/skills/ga4-attribution

AI agent skills for operators who build systems, not just campaigns

Install
npx -y skills add buildwitharup/cortex --skill ga4-attribution

Assembled 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:

  1. What paid channels are you running? (Google Ads, Meta, LinkedIn, other?)
  2. What CRM are you using? (HubSpot, Salesforce, other?)
  3. What does a conversion look like? (form fill, call, demo booked, purchase?)
  4. Is GA4 installed and tracking? (yes / no / not sure)
  5. Are UTMs being used consistently on all paid links?
  6. 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:

ParameterPurposeExample values
utm_sourceTraffic origingoogle, meta, linkedin, newsletter
utm_mediumMarketing channelcpc, paid-social, email, organic
utm_campaignCampaign namespring-launch-2026, brand-awareness-q2
utm_contentAd variant or creativeheadline-a, video-30s, carousel
utm_termKeyword (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 transaction
  • generate_lead — form submission with contact info
  • book_demo — demo or consultation booked
  • start_trial — free trial activated

Secondary conversions (engagement signals):

  • view_pricing — pricing page visit
  • download_asset — gated content downloaded
  • call_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:

ModelBest forHow it works
Last clickShort sales cycles (<7 days)100% credit to last touchpoint
First clickBrand awareness programs100% credit to first touchpoint
LinearMulti-touch nurture programsEqual credit to all touchpoints
Data-drivenHigh volume (1000+ conversions/month)ML-based credit distribution
Time decayLonger sales cyclesMore 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

ReportFrequencyAudience
Channel performanceWeeklyMarketing team
Cost per deal by campaignMonthlyMarketing + leadership
Attribution model comparisonQuarterlyCMO / CFO
Annual attribution reviewAnnuallyBoard

Output format

Deliver a closed-loop attribution setup package:

  1. Audit results — current tracking gaps identified
  2. UTM taxonomy — naming convention doc, ready for team use
  3. GA4 conversion events — what to set up and how
  4. CRM connection method — recommended approach for their stack
  5. Attribution model recommendation — with rationale
  6. Dashboard spec — metrics, sources, layout
  7. Reporting templates — weekly and monthly report formats

Related skills

  • analytics — for broader GA4 setup and tracking
  • ads — for the paid media layer this attribution measures
  • paid-media-smb — for SMB-specific budget and pacing context
  • revops — for CRM-side pipeline data connection

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.