Jump to content

How to create push data layer for GTM

Eduard J

Recommended Posts


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.

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


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

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

Edited by Curtis69
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...