The 5 UTM Parameters
utm_source— where the click came from (google, linkedin, newsletter, affiliate_name)utm_medium— how the click happened (cpc, email, social, referral)utm_campaign— which campaign it belongs to (spring_sale, launch_2026, retarget_abandoners)utm_content— which variant of the ad/link (sidebar, cta_button, hero_v2)utm_term— which keyword (for paid search only)
Example Tagged URL
Three Paths
- AI Chat (easiest)
- UTM builder tool
- Manual
Ask the AI:The AI generates the URL variants and exports them as a CSV or ready-to-paste list for your marketing tools.
Capture UTMs on Your Site
Reading UTMs is easy. Persisting them across pages and attaching them to conversions is where most sites go wrong.Save to localStorage or a cookie
utms_first_touch only if it’s not already set, so first-touch attribution doesn’t overwrite on later visits.Attach to signup/form submit
When a user submits a signup form, include the stored UTMs in the payload so they end up on the user record.
Database Schema
Add UTM columns to yourusers or signups table:
Analytics Integration
- Google Analytics picks up UTMs automatically. You’ll see Campaign, Source, Medium in the Acquisition reports out of the box. See Add Google Analytics.
- Hiveku visitor analytics captures referrer by default; adding UTM capture lets you attribute beyond raw referrer.
- Event-based tools like Segment, Mixpanel, or PostHog: forward the UTMs as properties on every event for proper funnel breakdowns.
Attribution Models
There’s no single “right” answer — each model tells a different story:| Model | Credit goes to | Best for |
|---|---|---|
| First-touch | The first UTM a user saw | Top-of-funnel / awareness campaigns |
| Last-touch | The last UTM before conversion | Bottom-of-funnel / closing campaigns |
| Multi-touch | Split across all touches | Longer sales cycles, multiple channels |
Build an Attribution Dashboard
Query your users table:Naming Conventions
Consistency matters more than cleverness:- Lowercase only.
LinkedInandlinkedinare different values in analytics. - No spaces. Use
-or_(pick one and stick with it):email-newsletteroremail_newsletter. - Abbreviate predictably.
cpcnotclick_per_cost;oct_launchnotoctober_product_launch. - Standardize values. Don’t use
social,Social, andsocial-mediafor the same medium.
Verify It Worked
Troubleshooting
UTMs not capturing
UTMs not capturing
Most common cause: JavaScript error on the page blocking the capture script. Open devtools console and look for red errors. Also check cookies aren’t disabled (try in normal browsing mode, not incognito with strict settings).
Data fragmented across cases (LinkedIn, linkedin, Linked-in)
Data fragmented across cases (LinkedIn, linkedin, Linked-in)
Standardize going forward and clean up historical data with a SQL UPDATE:Add a constraint or transformation at write time so it can’t happen again.
Cross-domain sessions lose UTMs
Cross-domain sessions lose UTMs
If visitors bounce between yoursite.com and app.yoursite.com, cookies may not transfer. In GA4, enable cross-domain tracking in Admin > Data Streams. For your own capture logic, use a cookie scoped to the top-level domain (
.yoursite.com).Organic vs paid search mis-attributed
Organic vs paid search mis-attributed
Google auto-tags paid search as
google / cpc via Google Ads’ auto-tagging feature (gclid parameter). Don’t manually add UTMs on top of this — you’ll double-count. Respect the auto-tagging and only use manual UTMs where the source doesn’t provide its own attribution.Revenue doesn't match payment processor
Revenue doesn't match payment processor
Attribution captures revenue at signup; refunds and chargebacks happen later. Build your attribution report off net revenue (post-refund) for accuracy. Update the stored
ltv_cents monthly from Stripe data.What’s Next?
Analytics
Track every important action on your site
Google Analytics
Connect GA4 for deeper attribution reports