Hi guys, this is Sofia
for measureschool.com. And in the previous video I showed you how
to implement ads conversion tracking without a value.
And today I will show you how to add dynamic values to your conversion.
So let's dive into it and to do that we
will need your online shop, your Google Tag Manager account and also
your Adwords account with the conversion we set up last time.
So we want to track the price and to be able to do that we will need a data layer.
So what is this mysterious creature?
Well a data layer is a JavaScript object
that takes information from your web page and passes it to the Tag Manager.
And here we have some example
with the book category, book title and book author.
And here you can see those values are changing dynamically.
In our case we will need data related to transactions.
So we are running the Ecommerce store
built with WordPress and this is why we implemented our data layer with the help
of the plugin which is called Google Tag Manager for WordPress.
In your case you might need to install a different plugin.
Or maybe you would have to ask a developer for help as you must have a data layer
implemented on your web page to be able to grab those values somehow.
Okay then the question how can we see this data layer?
It does not exist directly on the web page
so you cannot see it anywhere here but it lives in the background and we can
actually check it with the Tag Manager if we go to preview.
So the debugger is connected to my web page and we must make a test purchase.
So here is my confirmation page and if we
go to the debugger we can see the report and here step number 27.
This is exactly the event that fires when
someone makes a purchase and this event is created by the plugin.
So let's click here and if we check data layer we can see
the data layer with the values and here is exactly the value that we need and this is
called Revenue and we can see the price of the product that we bought.
So how can we actually grab this value?
Because we must do it to modify our tab.
So here we have Ecommerce object, then we have Purchase action field Revenue
and we will have to use the dot notation to grab this value.
If you're not sure how you can do that,
I recommend you an extension which is called the data layer checker.
So if you click here you can see our event
and if you click this event we can find our key which we can simply copy directly
from the extension and it's Ecommerce purchase action field Revenue.
So let's go to the Tag Manager and let's create a new variable.
So we click new and the user defined variables and this should be a data layer
variable and we simply paste it here and let's provide a name.
So I would say revenue and let's save it.
And we would have to implement also
the second variable for our transaction ID to avoid double tracking of purchase.
So let's click New
and here Data layer variable and we can
access it the same way as we did with Revenue.
Right.
So this is our transaction ID and how can we get to it?
Right? Ecommerce purchase action field ID again
if you're not sure you can use the extension.
So if we go here and click our extension here we have the ID and we can simply copy
this key and we go to the Tag Manager and paste it here.
And we should also provide a name and let's save our variable.
Awesome. Now we should also create a trigger.
As you can see the data layer is available when this specific event fires.
This is why we have to modify our trigger as well.
So let's create a new trigger actually.
And we can copy this event name here.
And let's go to the Tag Manager and click Triggers.
New
and here we can choose Custom event
and paste the name here and let's provide a name.
So let's say Purchase Adwords and let's save this trigger.
Now we can go to our tag and finally modify it.
So let's click our previous conversion
here and we should add our variables to it.
So in our case we need Revenue for value and ID for the transaction ID.
So here is our old trigger and we have
to change it and add the one that we created with our custom event.
Great.
So let's save our tag and now we have to make a test purchase again.
So let's click preview.
Great. So this is my confirmation page.
Let's go to our report and let's see what happens.
So tag has fired one time.
Amazing.
And let's check number 27 variables and we
can see the Revenue and also our transaction ID.
So your conversion was implemented correctly.
Good job.
Now we have to go to the Tag Manager and of course to publish the container.
So let's say Adwords purchase with a value
and let's save and publish our container.
One more small correction which has to be made.
We have to go to the Ads account
and we have to find our conversion that we implemented last time.
And here we click Edit settings value and instead of don't use a value we should
choose use different values because we have multiple products that have different
prices and we want to track this dynamically.
Great. And enter a default value.
It can be zero or one so that you can
identify if the conversion is not working immediately.
Let's click Save and done.
And if you go to your conversions
this is exactly where you would see your value.
So in my case I don't see it because this conversion is freshly implemented and it
takes some time for the conversion to be recorded.
Also it's important to remember
that a user must click your ad and then make a purchase.
Okay guys, so I hope you manage to implement your dynamic values
successfully and I wish you all happy measuring.
All right. Thanks Sofiia for these great insights.
If you guys want to see more Google Tag
Manager implementation videos, we have one linked up right over here
which should be quite interesting and from everybody here at measureschool.
Happy measuring.