How do I set up Google Analytics to ignore UTM parameters if utm_source=something (or medium/campaign)? I want GA to track it as a referral traffic instead (or direct traffic, if the referrer doesn't happen to be passed). I want GA to treat the link as if the UTM parameters did not exist.

Is this possible to accomplish?

  • You can add utm_nooverride=1 to the parameters where you want them ignored, and GA will act as if none of the utm_ parameters are there at all. May 5 '15 at 18:05

A solution would be to redirect away from UTM parameters with specific values. Google Analytics doesn't record the values until the JavaScript on the page executes. Server side redirects happen before Google Analytics has a chance to see the parameters.

# Remove the query string when it contains analytics
# parameters that should be ignored
RewriteCond %{QUERY_STRING} utm_source=something
RewriteRule (.*) /$1

If you can't modify your .htaccess, or you just want to do that for only some views, you can apply Search&Replace filter in your Google Analytics view like this:

Apply Search&Replace filter to medium in Google Analytics

Obviously, instead of "something" you put the target medium of that campaign. You can do the same for source and other utm parameters. You need to just create another filter and choose the respective filter field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.