We have been trying to setup a function such as below on a Sandbox pixel page that tracks Checkout and thank you. There is no one publicly available link that states that clearly and I just wanted to know for a Checkout and thank you Sandbox will this work?
function(){
var meta = window.ShopifyAnalytics && ShopifyAnalytics.meta;
if (meta && meta.page && meta.page.pageType) {
return meta.page.pageType;
}
var path = window.location.pathname || '';
if (path.indexOf('/checkouts/') === 0) {
return path.indexOf('/thank-you') > -1 ? 'thank_you' : 'checkout';
}
return 'storefront';
}
There is no single publicly available link that explicitly states:
“Inside Shopify’s sandbox iframe for web pixels, the global window.ShopifyAnalytics and its property ShopifyAnalytics.meta are available.”