1

We have a drupal 7 website, getting about +50.000 unique visitors each day. For statistical purposes, we are logging the events on the site, and one of the items logged is the referrer $_SERVER['HTTP_REFERER']. However, this is only captured less then 4% of the time, for 96%, $_SERVER['HTTP_REFERER'] is NULL. I know that $_SERVER['HTTP_REFERER'] isn't a trustworthy item, but 4% seems extremely low to me! I wrote a seperate PHP testscript to capture and log $_SERVER['HTTP_REFERER'], and this one works flawless, and the referer is filled in each time, from each browser/system/location I've tried. The Drupal 7 installation runs on 2 apache nodes with an apache loadbalancer.

Any tips on what might cause $_SERVER['HTTP_REFERER'] to be removed?

Borniet
  • 3,544
  • 4
  • 24
  • 33
  • Is there some kind of server-side redirect, when the page loads? – Peon Dec 17 '13 at 09:30
  • You mean in the httpd .conf or .htaccess files? – Borniet Dec 17 '13 at 09:33
  • The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. [documentation here](http://stackoverflow.com/a/12369682/631652) – Parixit Dec 17 '13 at 09:33
  • @Parixit Agree, it cannot be trusted, that I also mentioned in my question. But only 4% that has a HTTP_REFERER is too low. It should be somewhere around 60% to 80%, depending on the type of users you have (tech-minded vs not). The majority of our users are not tech-savvy. – Borniet Dec 17 '13 at 09:37
  • @Borniet All users came to your site from other domains or your domain? – Parixit Dec 17 '13 at 09:37
  • These 50.000 users come from other domains, about 60% comes from Google. – Borniet Dec 17 '13 at 09:40
  • @DainisAbols We do have quite some forwards in the .conf files of apache, due to compatibility needs with the previous (non drupal) version of the site. – Borniet Dec 17 '13 at 09:56
  • Well, in that case, go over [this](http://stackoverflow.com/questions/6880659/in-what-cases-will-http-referer-be-empty). Might help you. – Peon Dec 17 '13 at 10:04
  • @DainisAbols I would agree, but the proxy does keep the REFERER of my testscript? – Borniet Dec 17 '13 at 10:05

1 Answers1

-1

Maybe this can help you to track your users

https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get_destination/7

Aistis
  • 3,695
  • 2
  • 34
  • 34