0

If a user clicks on our webpage on a Google search results page, is there any way of knowing that the user came to our website from Google?

When I run:

<?php print_r($_SERVER); ?>

I can't see any details about the user coming from Google. Any other options?

p_mcp
  • 2,643
  • 8
  • 36
  • 75
  • 2
    `HTTP_REFERER`... but it cannot really be trusted as not all user agents will set this – B001ᛦ Aug 09 '18 at 15:02
  • You could also add a query parameter in the url and check it when you receive the request on your server. – Juan Aug 09 '18 at 15:03
  • HTTP_REFERER doesn't seem to work @B001ᛦ. – p_mcp Aug 09 '18 at 15:03
  • Also @Juan, how do you mean? We can't edit our listing on Google – p_mcp Aug 09 '18 at 15:05
  • 1
    _doesn't seem to work..._ I told you why ;) – B001ᛦ Aug 09 '18 at 15:05
  • You must tell google which is the url to link to, in that url you can add /?cameFrom=google, then check on your server if there is a query parameter cameFrom and if the value is google. – Juan Aug 09 '18 at 15:07
  • Interesting @Juan, do you mean we set some sort of tag on in our website HTML that Google then crawls, or we set it in a Google webmaster console (or similar)? – p_mcp Aug 09 '18 at 15:10
  • 1
    I did it for a landing page, but I didn't do the google configuration part. My client did it. But yes it is set on the google side. This is relate to google campaings, I forgot to mention that. – Juan Aug 09 '18 at 15:14

0 Answers0