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.1
Read from the URL on first load
2
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.3
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.
4
Persist across pages
Storing in localStorage or cookies automatically survives page navigation. If you set them via a third-party script, make sure scripts run on every page that might capture a signup.
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:
Most teams use both first-touch and last-touch side-by-side — awareness and conversion credit serve different marketing decisions.
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
1
Tag a test URL
2
Visit it in an incognito window
Incognito avoids picking up your existing session’s UTMs.
3
Open browser devtools
Check localStorage: you should see
utms and utms_first_touch keys.4
Submit a signup form
Complete a test signup. Then query your DB: the new user row should have
utm_source = 'test', utm_campaign = 'verify', etc.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