0

I have a service that we can consider it as a redirect url service . so when I open google analytics realtime screen I didn't find my domain in top referrers list .

header("HTTP/1.1 301 Moved Permanently"); 
header("Location: ".$url); 
exit();

my configurations is a 301 request status, chrome browser detect my domain as a referrer but google analytics not. redirect is from http to http

Any idea how I can figure out this problem ?

Croises
  • 18,570
  • 4
  • 30
  • 47
Ahmed Ashraf
  • 77
  • 4
  • 13

2 Answers2

0

In PHP, use:

header("Location: ".$url,TRUE,301);
exit();
Croises
  • 18,570
  • 4
  • 30
  • 47
  • unfortunately nothing happened – Ahmed Ashraf Jul 11 '16 at 10:59
  • You must add this code at the top of your page, before any output – Croises Jul 11 '16 at 12:08
  • And the referer can be null after redirect. Read: http://stackoverflow.com/questions/2158283/will-a-302-redirect-maintain-the-referer-string – Croises Jul 11 '16 at 12:15
  • it's on the top of the page , referrer is recorded in browsers request info but google doesn't record it at all this is the problem .. everything works fine except google analytics referrers list. – Ahmed Ashraf Jul 11 '16 at 13:43
0

Okay .. I figured it now guys ... you should pass ?utm_source=YourWebsiteName&utm_medium=referral

Ahmed Ashraf
  • 77
  • 4
  • 13