There are several ways I have seen this question worded, so I tried to make mine generic.
Let's say I go to this page:
example.com/page/?utm_source=test&s=test&page=12
get_query_var('utm_source') returns nothing.
$_GET returns Array ( [s] => test [page] => 12 ).
$_GET returns Array ( [utm_source] => ) from example.com/page/?utm_source (key only, no value), which I really don't understand.
I've done this in functions.php:
add_filter( 'query_vars', 'add_query_vars_filter' );
function add_query_vars_filter( $vars ){
$vars[] = "utm_source";
return $vars;
}
...just like ye olde codex says, so I would expect to be able to access utm_source through get_query_var('utm_source'). What am I missing?
utm_sourceparameter before your own code runs?$_GETsomething must be removing it really early. Maybe there is something in your Apache/PHP install that will remove thoseutm_...early on. What I would try is to write the$_GETvariable in theindex.php(so super early on) and also search all the files in your plugins for the stringutm_to see whether other plugins handle those variables.utm_sourcekey is in$_GETwhenutm_sourceis empty.