This article introduces how to solve the Rogue Referral problem in Adobe Analytics.
If your website is a SPA and you deploy Adobe Analytics, you may have Rogue Referral issues.
What is Rogue Referral
The problem with Rogue Referral is that since SPA is a single-page application, it is only loaded once when the web page is opened, and the ad tracking parameters are only on the first page. The special structure of SPA causes subsequent web page visits to not load, and the ad tracking parameters are lost.
For example, if you access the website through google/cpc, the first webpage has advertising parameters and can be identified as being divided into google/cpc, but the second page only has the referral parameter google.com, and google.com is a search engine, so it will divide into organic search.
We can check Venn diagram:
- Segment 1: Paid Search
- Segment 2: Natural Search
A large proportion of Unique visitors overlap, and there are Rogue Referral issues.
Solution
The solution is: only set the referrer parameter when the web page is opened or loaded, and do not set it for subsequent page visits. In this way, subsequent page visits can only be divided into the source of the first page visit.
The page loads, executes Rule 1, and clears cookies.
For the first page view: execute Rule 2 first (Control the execution order through Order 40). If the cookie has no value, it will not be triggered. Then execute Rule 1, set the Referrer parameter, and set the Cookie parameter.
For subsequent page view: execute Rule 2 first, the cookie has a value, perform normal tracking, and no Referral is set.
This ensures that the first PageView has Referral.
Rule 1:pageload:30:Clear Cookie
Suppose the cookie I set is named _test.
Core – Custom Code:
//clear cookie document.cookie = "_test=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
Rule 2:pageload:40:Others Page
In CONDITION, it is judged that the cookie has a value and is executed normally.
Rule 3:pageload:50:First Page
In CONDITION, judge that Cookie has no value, set s.referrer and Cookie _test:
Core – Custom Code – Set Global Variables:
s.referrer = _satellite.getVar('referrer'); var cookieName2= "_test"; var cookiePath = "/"; var expirationTime = 60*30; expirationTime = expirationTime * 1000; var date = new Date(); var dateTimeNow = date.getTime(); date.setTime(dateTimeNow + expirationTime); var expirationTime = date.toUTCString(); var v ="1"; document.cookie = cookieName2+"="+v+"; expires="+expirationTime+"; path="+cookiePath;