Retrieving referrer data after user has given consent
If a cookie-consent tool (for instance Cookiebot™ is used correctly it usually means that no tracking code (aka: 'TAG') is allowed to run at all when a visitor visits the site for the first time.
That also means that all information about the source of the visit is lost.
Why? The source of the visit is only kept by the visitor's browser once, for instance the source could be Facebook, or Google Ads, or a newsletter.
So, when a visitor agrees (or not) to the cookie statement, the webpage may reload and then use the analytics tracking code. In that case the referrer (where the traffic comes from) is the website itself as that is the previous page, showing as 'Undefined'.
Snoobi has built a specific code snippet that maintains the referrer data. It works unrelated to any tracking code, is automatically removed on a next click or next page.
It means that in many cases, Snoobi can analyse referrer data even when the cookie-consent tool doesn't run any tracking code initially.
In order to handle this, you will need to add this to the cookie consent function.
if(document.referrer && sessionStorage.getItem('__snbref')===null ) { window.sessionStorage.setItem('__snbref',document.referrer)}
The exact implementation on your website may be different due to differences in cookie consent tools.
Snoobi can be consulted when needed to assist in implementing.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article