Categories
Google Analytics User tracking

Google Analytics: URL aggregation/grouping by shortening (not removing) tracking parameters

Facebook, Pinterest and other platforms append (attach at the end) so called tracking parameters. These allow those platforms to efficiently track users.

Google Analytics: URL aggregation/grouping by shortening (not removing) tracking parameters
Google Analytics: URL aggregation/grouping by shortening (not removing) tracking parameters

Links clicked on Facebook look like this:

www.examples.com/some-page/?fbclid=asd89fasdf8as8f…

Links clicked on Pinterest look like this:

www.example.com/some-page/?epik=asu90asdifasdf…

The problem

Those seemingly random characters are unique to each click! This in turn causes a mess because Google Analytics sees now each of these URLs as unique pages. If you have 50 clicks to those pages you will see 50 individual pages listed in Analytics instead of 50 views of the same page.

A popular approach is filters to completely filter out the parameters completely, both the keys and the values:

www.examples.com/some-page/?fbclid=asd89fasdf8as8f…
is filter into this:
www.examples.com/some-page/?

It’s sure does clean up a mess but in my opinion you lose useful overview.

Tracking parameter keys (fbclid, epik etc) are not a problem, it’s their unique values that are. Those unique values prevent automatic aggregation/grouping.

Personally, I like to see right in the links where the click came from. Especially in “Realtime Overview”.

The fix

By retaining the parameter key, but not it’s value, you will get an automatic grouping by channel.

You can do this by using a replace filter in Views. (See image.)

FOR FB:

fbclid=[^&]*
fbclid=⋯

FOR PINTEREST:

epik=[^&]*
epik=⋯

[^&]* is RegEx for “any amount of any characters until the end OR until first occurrence of &”.

The “until &” is to make sure that if there are any other parameters after fbclid or epik, that they are not removed too.

I know that FB/Pin adds their tracking parameters at the very end, but I am not taking the chance that it will forever be like that, that there will not be some rearranging of parameters, or that a 3rd party won’t append additional parameters.

Note that in each case I replace the value with “⋯”. This is called a mid-line ellipsis sign. I replace to signify that there was some other value here and I use the mid-line ellipsis to slightly, but noticeably, distinguish it from the ellipsis that Analytics use themselves.

The nice thing about this solution is that you are NOT removing any interpretable data. You can’t extract any meaningful data whatsoever from the tracking values, so you are not really losing anything.

Remember, Views are NOT retroactive, meaning any edits to Views will apply to new stats only.

Pinterest also adds “pp=0”. I don’t know what it does so I am not filtering it out for now.

Leave a Reply

Your email address will not be published. Required fields are marked *