0
votes

In my current project requirement is to integrate enhanced eCommerce with GTM for tracking product impressions, product clicks, viewing product details, adding a product to a shopping cart, initiating the checkout process, transactions, and refunds.

For the above requirement I have placed GTM Container script and dataLayer variable immediately after the body tag in the layout page.

<script> dataLayer=[]; </script>

<script> GTM Container script </script>

Created Tags,triggers and custom javascript in the GTM to pass the data to GA.

My question is, do I need to populate the dataLayer object on the individual pages in the code? Or can we straight away populate the dataLayer object in the GTM interface by writing the custom javascript?

And where can I see the complete data in the GA that the dataLayer object is carrying?

If we write a "one API for all" the requirement, how do I call individual script in the GTM??

1

1 Answers

0
votes

If the datalayer you are currently working on already has all the correct enhance eCommerce items listed you do not have to do a datalayer.push as the information is already there.

You need GTM in the section, not just did you install GTM as per the documentation?

You can use custom JS in addition with a tag to do a datalayer.push on whatever pages require the additional product information. The tag is what you use to refrence the custom JS you have. The custom JS on it's own doesn't do a datalayer.push