Jump to content

How to create push data layer for GTM


Eduard J

Recommended Posts

Hi,

I'm facing trouble to implement push data layer code for each page I want to track via GTM. Want to create funnel from add to basket ---> purchase through out the all stages.

Here is so far what I have and it is showing as custom event in GTM, but I'm unable to get information such as product name, qty, item price etc.

{literal}
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });  // Clear the previous ecommerce object.
dataLayer.push({
'item': 'how to pull from page',
'quantity': 'how to pull from page',
'value': 'how to pull from page',
'event': 'begin_checkout'
});
</script>
{/literal}

 

If anyone has experience with this I would appreciate sharing it. 
Thanks 

Link to comment
Share on other sites

  • 3 months later...

dataLayer = window. dataLayer || []; dataLayer. push({ 'event' : 'trackEvent', 'pageType' : 'Blog', 'userID' : '12345', 'loginStatus' : 'logged in' }); Note: while event keys aren't strictly necessary for a data layer push, every tag in GTM needs an event key to trigger it. JCPenneyKiosk

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...