Analytics
3.2K members online now
3.2K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Filter to rewrite source/medium when destination page contains parameter XYZ

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

 Hi all, 

 

We're receiving a lot of affiliate traffic as direct traffic due to improper use us utm tags.

At this point, probably the fastest way for us to resolve this, going forward, is to use a filter that changes the source/medium when a certain query parameter is present in the url of the destination page. 

 

Does anyone know how to do this using fliters in Google Analytics?

 

Thanks in advance!

1 Expert replyverified_user

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭
Hi Brat,

you can use custom filters to filter any campaign source. for creating a custom filter navigate to admin >> filters and create a new filter

this article will be more helpful for you
https://support.google.com/analytics/answer/1034842?hl=en

If my answer helped you let me know by giving a star Smiley Happy

Cheers
Noman karim

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Noman,

Thanks for your reply. I'm not trying to exclude the traffic source though.
For direct traffic with a certain query parameter, I want to chance the source & medium.

Any tips on how to acchieve this?

Thanks!
Bart

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
I'm hoping someone will see this as a challenge and get back to me with a solution Smiley Happy

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Rising Star
# 5
Rising Star
Bart,

You MAY be able to do it with filters with great difficulty, that said, are you using GTM? Or do you have developers?

I'm asking because I always prefer to shape the hit first - before it gets to GA for processing. If you have GTM you can do this in a couple of minutes. If you have developers, you can have them dynamically generate the Google Analytics Tracking Code (GATC) and set the campaign params or you can have them, on the server level look for the param and do a server side redirect to include the proper utm params.


Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
I found a solution, which seems to be working fine.
Created two advanced filters that look for the request URI (field A). The first changes the campaign source, the second changes the campaign medium.

Published the change last week and I'm now seeing real differences between my test view and live view.

Hope someone will benefit from this Smiley Happy

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
Hi Theo,

I'm using GTM and am curious about your method.
Like you, I prefer to shape the hit before GA starts processing.

Thanks in advance for sharing!
Marked as Best Answer.
Solution
Accepted by topic author Bart v
September 2016

Re: Filter to rewrite source/medium when destination page contains parameter XYZ

Rising Star
# 8
Rising Star

Hey Bart,

 

You need to set up a variable to capture the parameter in question and then use a lookup table based upon that variable or, more simply, use it as a trigger to fire a different version of the GA tag that sets the field parameters. Which method you use depends on your unique situation. If it's only one parameter then you may just want to use another tag. 

 

ss query param rule.pngss query param.png

 

 

If you use two tags, you should also block the firing of the normal tag when the parameter is present and the other tag is firing - just use the exception. 

 

Your tag should look something like this:

 

ss set camp fields GTM.png

 

In this case, the query param would be affid e.g. ?affid=amazon ; so you'll have to change it to whatever yours is. 

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn