Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does referer effects GA tracking?

I am thinking to add Referrer-policy header in my app. Setting this header to :-

Referrer-policy - origin when cross origin will send only base url (http://www.example.com) in referer header to all the third parties.

Is there any chance that this might effect Google-Analytics tracking ?

like image 561
Ranjan Kathuria Avatar asked Aug 31 '25 05:08

Ranjan Kathuria


1 Answers

AFAIK Google does not use HTTP referer header field. It uses it's own Document Referrer dr field which is initialized as:

This field is initialized by the create command and is only set when the current hostname differs from the referrer hostname, unless the 'alwaysSendReferrer' field is set to true.

And you may change it by: ga('set', 'referrer', 'http://example.com')

like image 109
xmedeko Avatar answered Sep 03 '25 22:09

xmedeko