Hi,
Has anyone experienced slow GTM container loads within the sandbox customer pixel using the app’s code? In my case, the container loads after the page viewed and checkout started events so the begin checkout event is never captured.
I’ve added the following logging:
window.analytics = analytics;
window.initContext = init;
console.log('Start GTM fetching');
analytics.subscribe("all_standard_events", (event) => {
console.log('Shopify event: ' + event.name);
});
fetch('https://sp.stapecdn.com/widget/script_pixel?shop_id=99255845241')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then(scriptText => {
const scriptElement = document.createElement('script');
scriptElement.textContent = scriptText;
document.head.appendChild(scriptElement);
console.log('Start GTM injecting');
analytics.subscribe("all_standard_events", (event) => {
gtmEvent(event);
});
})
.catch(error => {
console.error('There was a problem fetching the script:', error);
});
Here what I see:
The dataLayer looks like this:
Is there any known workaround for this?

