I'm trying to accommodate GDPR by not loading our analytics scripts until the user consents.
The way I'm doing it works as expected in every browser we support but FF Quantum's private browsing window. (If it helps, it works as expected in Chrome Incognito)
This is the code that I'm using below:
/**
* @name loadAnalytics
* @function
* @param {boolean} [consented] Determines if the consent click event should be tracked
*/
function loadAnalytics( consented ){
if( analyticsExists() ) return callbackAnalytics( consented );
if( !window.analyticsScriptURL ) return;
var script = document.createElement( 'script' );
script.src = analyticsScriptURL;
script.type = 'text/javascript';
script.async = true;
script.onload = script.onreadystatechange = callbackAnalytics.bind( this, consented );
document.head.appendChild( script );
}
Is this a security thing or is there something I'm missing?