![]() This opens up a menu with all your different variables in here. So we will dynamically insert our variable, which can be done with two curly brackets. Now we need to customize this because we don’t want all our products to result in 99 dollars once this fires. Give the Tag a name and as the HTML code, paste the JavaScript code that you had copied. Well now, we can go to the next step and copy our JavaScript code. What does that mean? And where can we use them? Click on Save and we have this now available in the Google Tag Manager as a variable. So in our case, it will be transactionTotal. That is the key that we see in the Javascript object. The only configuration needed is the Data Layer Variable Name. We have named it as dlv-transactionTotal. I will Choose variable type as a Data Layer Variable and this will allow me to access the information from the data layer. Now variables are like place holders, so you can build them dynamically to pull them from places like the data layer. To do this, I will build a variable in Google Tag Manager. I’m just going to try to pull the transaction total from the data layer. In our case, that doesn’t really change so I won’t pull this from the data layer. ![]() You also have a transactionCurrency in here, which you could use if you had different currencies in your store. You can note that the transactionTotal here resembles the total amount that was bought by the user. In our case, we have this huge data layer push, which is the gtm4wp.orderCompletedEEC. Once I’m back on the thank you page, I can look into my data layer and see how it was filled with values. So let’s do that and then go through another conversion. In order to see the data layer, and where the information is, we need to enter our preview and debug mode. This plugin will fill the data layer for you automatically if you are on a website. Now since I’m here on a Woocommerce store, I’ve installed a plugin by Thomas Geiger, which is the Google Tag Manager for WordPress. The most robust way is to build a custom data layout. How can we get the amount into Google Tag Manager dynamically? Well, there are different methods and we have discussed them in our guide on Conversion Values. This is the amount that we want to send over to Facebook and dynamically fill into the event that we send to Facebook. In any online store, you would land on an order received page, or a thank you page, where you would normally see how much you have spent on your order. So just to give you an example, let’s go back to our demo shop and buy a product. ![]() You would need to dynamically insert this with the help of Google Tag Manager. Thus, it is obvious that not all of our purchases should be marked as 99 dollars. The currency is usually not changing but sometimes could be dynamic as well. If you have a conversion value for example of 99 dollars, and currency as USD, it will make your data much better. How to Set Purchase Amount Dynamically in GTM? For the Purchase event, you simply deploy the tracking code. We have already installed this Facebook Base Pixel code on our page and if you click Continue, you have the custom events.įor conversion tracking, we want to select the Purchase event. For this, go to Set up and then click Manually Install the Code Yourself. ![]() Now, there is one thing that is missing, which is very important for Facebook ads i.e. I re-installed the Pageview event and the Add To Cart event on button clicks of the Add to Cart button. In our last guide, we have already installed our Facebook Base Pixel, which you need to have installed in order for other interactions to be picked up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |