Updated referrer attribution for empty history
- empty history means attribution script is not loaded, which should be only when its behind the flag
This commit is contained in:
parent
eb7547ea3c
commit
fe90dde0e1
@ -28,9 +28,10 @@ class ReferrerTranslator {
|
||||
* @returns {ReferrerData|null}
|
||||
*/
|
||||
getReferrerDetails(history) {
|
||||
// Empty history will return null as it means script is not loaded
|
||||
if (history.length === 0) {
|
||||
return {
|
||||
refSource: 'Direct',
|
||||
refSource: null,
|
||||
refMedium: null,
|
||||
refUrl: null
|
||||
};
|
||||
|
@ -244,7 +244,7 @@ describe('ReferrerTranslator', function () {
|
||||
|
||||
it('returns null for empty history', async function () {
|
||||
should(translator.getReferrerDetails([])).eql({
|
||||
refSource: 'Direct',
|
||||
refSource: null,
|
||||
refMedium: null,
|
||||
refUrl: null
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user