I am a newbie with GTM and I noticed there are tons of things to learn and setup in GTM. Things to take consideration regarding the environment I work in:
- I work with VB.NET, so every file I work with has a mark-up page (.aspx) and a codebehind (.aspx.vb)
My questions are the following:
1) I understand that, for eCommerce, the following Data Layer must be located in the .aspx page of my code:
<!-- DATA LAYER -->
<script>
dataLayer = [{
'transactionId': '1234',
'transactionAffiliation': 'Acme Clothing',
'transactionTotal': 38.26,
'transactionTax': 1.29,
'transactionShipping': 5,
'transactionProducts': [{
'sku': 'DD44',
'name': 'T-Shirt',
'category': 'Apparel',
'price': 11.99,
'quantity': 1
}]
}];
</script>
<!-- END OF DATA LAYER -->
<!--- GOOGLE TAG MANAGER CODE GOES BELOW DATA LAYER AFTER BEGINNING OF BODY TAG -->
GTM CODE GOES HERE
<!--- END OF GTM CODE -->
I understand that the variables such as 'Acme Clothing', 'T-Shirt', 'Apparel', etc. can be changed as well as the prices.
I also understand that the transactionProducts is basically an array of products.
How would I go about ADDING new products to the array? Is my data layer in the .aspx correctly setup?
How would I go about modifying this data layer from the vb.net (.aspx.vb) code behind?
I am really confused about this as I cannot find any examples online.
Any help will be appreciated.
Thank you