@vivareal/tracking
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -440,4 +440,4 @@ 'use strict'; | ||
const getFromUtmReferrer = urlReferrer => { | ||
if (!urlReferrer) return null; | ||
const getFromUtmReferrer = (urlReferrer, isReferrerTheCurrentLocation) => { | ||
if (!urlReferrer || isReferrerTheCurrentLocation) return null; | ||
if (URLS.matchesSearchEngine(urlReferrer)) return getUtmReferrer({ | ||
@@ -459,5 +459,6 @@ urlReferrer, | ||
referrer, | ||
previousUtmValues | ||
previousUtmValues, | ||
isReferrerTheCurrentLocation | ||
}) => { | ||
if (referrer) return getFromUtmReferrer(referrer); | ||
if (referrer && !isReferrerTheCurrentLocation) return getFromUtmReferrer(referrer); | ||
if (previousUtmValues) return previousUtmValues; | ||
@@ -483,3 +484,4 @@ return { | ||
}) => { | ||
if (referrer && host && referrer.includes(host)) return previousUtmValues; | ||
const isReferrerTheCurrentLocation = referrer && host && referrer.includes(host); | ||
if (isReferrerTheCurrentLocation && previousUtmValues) return previousUtmValues; | ||
const params = new URLSearchParams(search); | ||
@@ -490,7 +492,8 @@ const URL_UTM = getFromUrl(params); | ||
if (GCLID_UTM) return GCLID_UTM; | ||
const URL_REFERRER_UTM = getFromUtmReferrer(params.get('utm_referrer')); | ||
const URL_REFERRER_UTM = getFromUtmReferrer(params.get('utm_referrer'), isReferrerTheCurrentLocation); | ||
if (URL_REFERRER_UTM) return URL_REFERRER_UTM; | ||
return getFromDocumentReferrer({ | ||
referrer, | ||
previousUtmValues | ||
previousUtmValues, | ||
isReferrerTheCurrentLocation | ||
}); | ||
@@ -497,0 +500,0 @@ }; |
@@ -436,4 +436,4 @@ import { parseDomain } from 'parse-domain'; | ||
const getFromUtmReferrer = urlReferrer => { | ||
if (!urlReferrer) return null; | ||
const getFromUtmReferrer = (urlReferrer, isReferrerTheCurrentLocation) => { | ||
if (!urlReferrer || isReferrerTheCurrentLocation) return null; | ||
if (URLS.matchesSearchEngine(urlReferrer)) return getUtmReferrer({ | ||
@@ -455,5 +455,6 @@ urlReferrer, | ||
referrer, | ||
previousUtmValues | ||
previousUtmValues, | ||
isReferrerTheCurrentLocation | ||
}) => { | ||
if (referrer) return getFromUtmReferrer(referrer); | ||
if (referrer && !isReferrerTheCurrentLocation) return getFromUtmReferrer(referrer); | ||
if (previousUtmValues) return previousUtmValues; | ||
@@ -479,3 +480,4 @@ return { | ||
}) => { | ||
if (referrer && host && referrer.includes(host)) return previousUtmValues; | ||
const isReferrerTheCurrentLocation = referrer && host && referrer.includes(host); | ||
if (isReferrerTheCurrentLocation && previousUtmValues) return previousUtmValues; | ||
const params = new URLSearchParams(search); | ||
@@ -486,7 +488,8 @@ const URL_UTM = getFromUrl(params); | ||
if (GCLID_UTM) return GCLID_UTM; | ||
const URL_REFERRER_UTM = getFromUtmReferrer(params.get('utm_referrer')); | ||
const URL_REFERRER_UTM = getFromUtmReferrer(params.get('utm_referrer'), isReferrerTheCurrentLocation); | ||
if (URL_REFERRER_UTM) return URL_REFERRER_UTM; | ||
return getFromDocumentReferrer({ | ||
referrer, | ||
previousUtmValues | ||
previousUtmValues, | ||
isReferrerTheCurrentLocation | ||
}); | ||
@@ -493,0 +496,0 @@ }; |
{ | ||
"name": "@vivareal/tracking", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "A set of tracking events helpers", | ||
@@ -47,3 +47,3 @@ "author": "Grupo ZAP", | ||
}, | ||
"gitHead": "528147920018a01a1f10946f1875e5dcbd566eca", | ||
"gitHead": "e7cfaa66c9ea8d2dae7426fd090a2f6059d3a0ce", | ||
"dependencies": { | ||
@@ -50,0 +50,0 @@ "@rollup/plugin-babel": "^5.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36554
1018