WordPress filtering utm_ GET variables from url unless logged in as admin, not sure why?

So I am having an issue where I can’t pull variables such as mysite.com/?utm_campaign=testing unless I am logged in as admin or editor.

When logged out and just a regular users I can’t grab any variables which start in utm_ such as utm_campaign. However utmcampaign works, and any other variable I try. Just not utm_ ones.

Read More

I disabled all my plugins but still have the same issue. Not sure where the filtering is coming from and not sure why it only filters when not logged in as admin.

I tried accessing the variable using three different methods:
1. Injecting PHP code using the “Code Insert Manager” plugin

 <?php echo $_GET['utm_testing']; ?> 
  1. Using the built-in function of formidablepro to grab the GET variables.

  2. Using the same code as #1 but inside my footer.php file of my template.

All have same results.

Related posts

3 comments

  1. It’s not a core behaviour to overwrite the global $_GET array, which means it’s likely that something else then WordPress itself is the issue here.

    I would suggest the following steps to debug the issue:

    • Disable all active plugins and revert to standard theme, see if the problem persists.
    • If the problem is still there, open the index.php in your document root and write var_dump($_GET); exit(); in the first line to see if the variable is making it through the webserver. If it isn’t showing up now, it means that it is filtered for some reason by the webserver (i.e. bad .htaccess rule, or conflicting mod_security rule).
  2. If you have a hosted solution check to see if any page caches are stripping/ignoring the values. Get Parameters generally require the page request to be processed by the origin server. If the request does not hit the origin then you will not get an opportunity to process the GET params – equally if the params are stripped upstream – you may receive the request but the params may no longer exist.

    Data capture vs performance

    d.

Comments are closed.