0

I am facing this (I don't know what to call this) situation I have a URL like

site.com/?utm_campaign=value&other=1&more=2

the problem is that when i

var_dump($_GET);
// prints
array( 'other' => '1', 'more' => '2');

for some reason the parameter utm_campaign is missing from $_GET array.

any ideas? the server request_uri is

'REQUEST_URI' => string '/site-com/?other=1&more=2'

its even missing in $_SERVER['REQUEST_URI'] and the server is hosted in Godaddy and the WPEngine is not being used.

there is a javascript solutions in case some one else wanted to use but in my case I require it in php $_GET.

var url_string = window.location.href;
var url = new URL(url_string);
var utm_campaign = url.searchParams.get("utm_campaign");
console.log(utm_campaign); 
codedudey
  • 369
  • 3
  • 10
  • You have to precise taht your site is hosted (by godaddy) – Dri372 Jun 14 '21 at 16:34
  • @Dri372, thanks, added to question – codedudey Jun 14 '21 at 16:38
  • And the answer is probably here https://stackoverflow.com/questions/21567004/having-utm-in-the-url-string-breaks-the-get-variable-in-wordpress ... I'll put my anser on the first one for you to be able to close the first post. – Dri372 Jun 14 '21 at 16:45
  • @Dri372, the WPEngine is not being used here. – codedudey Jun 14 '21 at 16:50
  • OK, but I don't tthing it's relating/only with WPEngine ... we should do the test on other hosted site ... personnaly I don't use it, i host my servers (physicaly and on vps) – Dri372 Jun 14 '21 at 16:55

0 Answers0