You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partytown and GTM integration docs page says we should add dataLayer.push to the forward array.
But after doing it immediate call of dataLayer.push stops to work.
index.html
<script src="/head-scripts/partytown.config.js"></script>
<script src="/~partytown/debug/partytown.js"></script>
<script>
if (!navigator.isServer) {
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l !== 'dataLayer' ? '&l=' + l : '';
j.type = 'text/javascript';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '#gtmAccountId#');
// Immediate call of dataLayer.push which is working if not forwarded
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
partyTownEnabled: true,
event: 'Partytown_ready'
});
}
</script>
Although dataLayer.push isn't working in chrom console, most of data is pushed to gtag manager.
However we missed all data from mobile web, maybe partytown works only on desktop version?
@thekingbk90 Not sure what case are you describing but it definitely doesn't send an event in my example.
I set up a testing project in gtm and tag was never triggered.
Setting 1000ms timeout or excluding it from forward makes it work. But my intention is to pass a feature flag to manage which gtm scripts should be handled by partytown
Describe the bug
Partytown and GTM integration docs page says we should add
dataLayer.push
to the forward array.But after doing it immediate call of
dataLayer.push
stops to work.index.html
/head-scripts/partytown.config.js
If I am removing it from forwarded list - it works like a charm.
Reproduction
https://tp8h37-5000.csb.app/
Steps to reproduce
Actual:
Only
GTM started
message is outputExpected:
GTM started
andPartytown enabled: true
messages are outputBrowser Info
Chrome
Additional Information
Not sure but maybe it is caused by this partytown code
delete win[property.split(".")[0]];
The text was updated successfully, but these errors were encountered: