Hello,
I recently got an email from klaviyo about multiple api key set up on the same store. so i checked on my side the theme and the third party applications but for me i only inject it at one place in the liquid theme and the klaviyo implementation is cut.
I’ve attached a screen of the multiple script injections on my landing page, where you can see two different apis keys each doubled.
While investigating, I came across the index.js file injected by Shopify with this part of the quote that deals with script injection and you can actually see 2 times each scripts with different api keys, I’d like to know where these injection urls come from and what defines them ( application, scripts, external, …)
<script>(function() {
function asyncLoad() {
var urls = [
"https:\/\/static.klaviyo.com\/onsite\/js\/klaviyo.js?company_id=V8W\u0026shop=joone-de.myshopify.com",
"https:\/\/static.klaviyo.com\/onsite\/js\/klaviyo.js?company_id=V8W\u0026shop=joone-de.myshopify.com",
"https:\/\/static.klaviyo.com\/onsite\/js\/klaviyo.js?company_id=Tmt\u0026shop=joone-de.myshopify.com",
"https:\/\/static.klaviyo.com\/onsite\/js\/klaviyo.js?company_id=Tmt\u0026shop=joone-de.myshopify.com",];
for (var i = 0; i <urls.length; i++) {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = urls[i];
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
};
if(window.attachEvent) {
window.attachEvent('onload', asyncLoad);
} else {
window.addEventListener('load', asyncLoad, false);
}
})();</script>
if you need any further information, please do not hesitate to contact me.