<script> addEventListener('message', (event) => { if (JSON.stringify(event.data).includes("shopify_pixel_event")) { try { let json_data = JSON.parse(event.data.json) } catch (SyntaxError) { let json_data = {} } if (typeof(event.data.event_name) !== 'undefined') { window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: event.data.event_name, data: json_data }); } } }); </script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter