In one of the shopify theme I am working with I found that some code related to analytics is not working properly on the home page.
Here is the code that works properly
window.ShopifyAnalytics = window.ShopifyAnalytics || {};
window.ShopifyAnalytics.meta = window.ShopifyAnalytics.meta || {};
window.ShopifyAnalytics.meta.currency = 'INR';
var meta = {"page":{"pageType":"home"}};
for (var attr in meta) {
window.ShopifyAnalytics.meta[attr] = meta[attr];
}
here is the code that do not work
window.ShopifyAnalytics = window.ShopifyAnalytics || {};
window.ShopifyAnalytics.meta = window.ShopifyAnalytics.meta || {};
window.ShopifyAnalytics.meta.currency = 'EUR';
var meta = {"page":{}};
for (var attr in meta) {
window.ShopifyAnalytics.meta[attr] = meta[attr];
}
see the var meta
It should have pageType property, but its missing
the code snippets are from the developer tool → elements
I am not able to find a place in the theme code related to these script, I think its added by Shopify dynamically.