|
Post by account_disabled on Nov 23, 2023 0:18:58 GMT -6
New or returning customer How to create a Data Layer Variable in GTM First, you should analyze the data available in the Data Layer. There are various ways to do this, and you could use Google Tag Manager's preview mode to analyze which data layer variables the system sees. But there is an even quicker and more precise way: if you use Google Chrome, once on the page you are interested in (in this case the order confirmation page. After purchasing the product you are interested in, although in reality you can find the same variables also on the product page itself), right click on the page and click on "inspect". At this point, move to "Console", and type "Datalayer" in the C Level Contact List console. Once isolated, hit enter. Now you can explore the Data Layer and find the information you are interested in. In our case, the information is nested inside a data Array. Let's take an example. If I were to simply create the Data Layer Variables for dynamic remarketing , for example or , all I would have to do was create the aforementioned variables in GTM by selecting " Data Layer Variable ", and inserting the exact wording as the name of the variable to be consider. But when, as for the "ID", the information is nested inside an Array , the situation becomes complicated and it is necessary to use a code to explain to Tag Manager which lines to read.
|
|