Randy Cole
asked on
Google Analytics Data Layer - is this code the only code I need to install on my site (other than my UA tracking code)
I'm trying to capture some data from an e-commerce session. The product name, price, etc will be ever-changing and the quantity, transaction ID and total amount will obviously differ for each purchase. My question, is the code below the ONLY code I need to install to use the data layer in conjunction with Google Analytics? The support on Google's site is difficult for me to understand, at first they say this is the code to install and then their next example shows the code with transaction ID, price, etc. I'm assuming that information is passed into the data layer as an array provided the code pasted below is installed exactly as I pasted it.
<script>
dataLayer = [];
</script>
<script>
dataLayer = [];
</script>
<script>
dataLayer = [];
</script>
ASKER
Thanks Randy: if I want to pass data such as price and quantity into the data layer, will I need to hard code that into the data layer snippet or is it something that I can populate with Google Tag Manager?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window