` } ]; window.addEventListener('load', () => { if (window.navigator.userAgent.toLowerCase().indexOf('googlebot') > -1) { scripts_filters = default_script.filter( scripts => scripts.comment !== '' ); } setTimeout(async () => { await scripts_filters.forEach(async elm => { // remove klaviyo script by date if(elm.endDate != undefined || elm.endDate != null || elm.endDate != ""){ if(elm.endDate < new Date().toLocaleDateString('sv-SE', { timeZone: 'America/Los_Angeles' })){ return; } } var tag = await document.createElement(elm.tag); Object.entries(elm).forEach(function([key, value]) { if(key == "attributes"){ Object.entries(value).forEach(function([key, value]) { tag.setAttribute(key, value); }); }else if(key != "comment" && key != "content" && key != "tag"){ tag.setAttribute(key, value); }else if(key == "content"){ tag.innerHTML = value; } }); if ($("#product_id").val() ?? '') { let comment_adroll = typeof elm.comment !== 'undefined' ? elm.comment : ''; if ( comment_adroll !== 'undefined' && comment_adroll.includes('Adroll')){ tag.setAttribute("id", 'adroll_track'); observer_adroll.observe(tag); }; } document.getElementsByTagName( "head" )[0].appendChild( tag ); }); load_tracking_pinterest(); }, parseInt(4000)); });