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); 
5
  • You have to precise taht your site is hosted (by godaddy) Commented Jun 14, 2021 at 16:34
  • @Dri372, thanks, added to question Commented Jun 14, 2021 at 16:38
  • And the answer is probably here stackoverflow.com/questions/21567004/… ... I'll put my anser on the first one for you to be able to close the first post. Commented Jun 14, 2021 at 16:45
  • @Dri372, the WPEngine is not being used here. Commented Jun 14, 2021 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) Commented Jun 14, 2021 at 16:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.