1

I'm trying to track page views in google analytics using utm parameters, but they're getting stripped out of my urls when loaded. The problem appears to be specific to the WordPress theme I'm using, but I haven't been able to locate any code in the theme files that would cause this behavior.

I'm using a child theme, but the behavior is present in the parent theme and can publicly be seen here: http://coolist.themewaves.com/food/2016/10/31/consequat-ipsum-sagittis-sem-nibh-elit-duis-sed-odio-amet/?utm_source=sourceexample&utm_medium=facebook

Everything I add after "?" is ignored, which prevents me from tracking traffic. Locally, I've disabled all plugins but the behavior persists. However, if I switch to a completely new theme the tracking links do work, so I don't believe it to be a configuration issue. (My .htaccess file is the standard basic file w/o any modifications).

I've been searching the code base for any functions that could cause redirects or otherwise modify the url (e.g. remove_query_arg, anything with the word "redirect") but no luck so far.

Does anyone have suggestions for things to try or potential causes? Any input would be greatly appreciated, many thanks!

abbie
  • 65
  • 7

1 Answers1

2

Given the link, I can see that there is problem with your header image scroll.

It removes the parameters after you scroll through the header image. But that is ok because UTM parameters are meant for landing pages and not for subsequent pages. GA automatically attributes the utm parameters to the session once the user lands on the landing page, even if it is removed in subsequent interactions. Hope this makes sens

PS - If the given link is a testing URL then I couldn't find the GA code

AnkDasCo
  • 1,439
  • 11
  • 16
  • Thank you for pointing out that GA will track accurately even after UTM parameters are removed, that was really helpful in directing my focus towards the root of the problem. We're testing a fix with the GA code loaded in a different place/way for infinitely scrolled pages so that GA can record them before they're removed. (And no, the provided test link didn't have any GA code... unfortunately couldn't share our live link.) Thanks again for your help! – abbie Sep 14 '18 at 18:51