Somehow there are more than one klaviyo codes in my shop. Support have told me to deactivate and it will automatically remove it which it hasn’t. So they have asked me to remove the code manually which I am struggling with.
I have tracked it down to something happening within jquery.min or at least seems to be. However the code means very little to me. I am assuming it is pulling data from somewhere to get the url to pull for the code, however that is as far as I have got. Any ideas?
Best answer by retentionView original
It turns out that if you installed Klaviyo via the Shopify App and “Registered a New Klaviyo Account” multiple times, it can link Shopify to more than one Klaviyo account. This can sometime happen when someone clicks on the Shopify Klaviyo App, and instead of logging in, creates a new account by accident.
What makes matters worse, Shopify “Injects” these App dependent libraries at runtime, so you don’t see them in your Shopify Template code (as far as I know).
Hope this helps and report back how you fixed it!
Yea to echo what
@retention said (great description) this is most likely due to integrating 1 Shopify store with different Klaviyo accounts, thus creating multiple js scripts on 1 Shopify site.
From the technical approach, if you’re interested in deleting the scripts yourself, you would need to utilize the API to do so.
You would use the GET scripttags endpoint https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag#index-2020-10 to fetch a list of the tags. In the response there would be an ID and then you would run a DELETE request: https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag#destroy-2020-10 with that ID.