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??