AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

4.5K members online now
4.5K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

ignore/overwrite campaign parameters on self referrals

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Is there a way to ignore utm parameters from internal links?


My business is consolidating several dozen blogs, each hosted on their own domain, into one. The blogs have tons of links pointing to the new domain (e.g.,, were linking to; now the blogs are coming over to, etc).


The links include utm parameters. To complicate matters, many of the blogs were using URL shorteners, so it's impossible to do a find/replace during content migration.


Since we can't eliminate the utm parameters from the blog posts, we're trying to find a way to ignore/overwrite utm parameters in GA if the referrer is I found this post which gives me hope, but as a JS noob I'm a bit stuck. Is there a way to tweak this code - or a different method altogether - to ignore/overwrite utms in the case of a self-referral?


If relevant, we're using GTM to fire GA.

1 Expert replyverified_user

ignore/overwrite campaign parameters on self referrals

Top Contributor
# 2
Top Contributor



the resource you found provides the best method.

If you use GTM, you can create custom variables to extract UTM parameters from the URL and store them in campaign parameters in the pageview call.

This is something I can help you with if needed.

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan