Hey there, I'm Benjamin from Loves Data. In this video, you will learn how to create
custom triggers to track conversions. We will look at how to set up the Google Ads
conversion tracking tag, and how to track a custom conversion into Google Analytics 4
(or GA4). This is the fifth lesson in my Google Tag Manager training series.
So far, we've covered how to get started, adding tags, previewing and testing your tags,
and how to migrate to Google Tag Manager. Okay, let's get started!
During this training series, we've covered tags that are fired on all of the pages of our website.
However, there are times when you will need to trigger a tag on certain pages
or for certain actions. Let's start by adding a Google Ads conversion tracking tag that only
fires on a specific thank you page. To do this, we're going to create the tag in Google Ads, then
we will need to create a new tag and trigger in Google Tag Manager. So let's head to Google Ads...
Okay, I'm in my demo Google Ads account... And to create a new conversion tracking tag
I'm going to select 'Tools'... And then 'Conversions'...
I'm going to create a new dedicated Google Ads conversion tracking tag.
To do this, we're going to click the plus sign... And then we're going to choose 'Website'...
There are a few details we need to enter for our conversion. We need to select a category
for the conversion. This is for reporting and segmentation in Google Ads. I'm going
to select 'Sign-up' for my conversion, but you can choose from any of the available options...
Now we need to name the conversion. I'm going to name this conversion 'Email Signup'...
We can then choose to assign a value for each conversion. I'm going to select the first option
which means that every conversion will be given the same value... And I'm going to enter $10 as
the value. This is just a symbolic dollar value, but you should try to calculate the average value
for each of your conversions. I'm going to keep things simple today, but if you'd like to learn
more about Google Ads, then check out the extra resources in the description below this video.
Okay, now I'm going to select 'One' for the count. This means that if someone completes
our email signup form multiple times, we will only count one conversion. If you're selling items or
want to count multiple conversions from the same person, then you should select 'Every'. I'm going
to leave the other default options selected... And I'm going to click 'Create and continue'...
Now we're given the dedicated Google Ads conversion tracking tag... Let's select the Google
Tag Manager option... And we need to copy the 'Conversion ID'... And the 'Conversion Label'...
Now it's time to head to Google Tag Manager... We need to create a new tag...
Let's name the tag 'Google Ads Conversion'...
And let's select 'Tag Configuration'... And choose 'Google Ads Conversion Tracking'...
Now we can enter the 'Conversion ID' from Google Ads... And the 'Conversion Label'...
Next, we need to add a trigger to our tag. Let's select 'Triggering'... And since we
only want to fire this tag on a specific page on our website, we're going to create
a custom trigger. To do this, we click the plus sign on the top right corner...
Let's name our trigger 'Thank You Page'... And let's select 'Trigger Configuration'...
And we're going to choose 'Page View'...
By default, we can see that the 'All Page Views' option is selected, but we only want
this trigger to fire our tag on a specific page, so let's change this to 'Some Page Views'...
And we're going to select 'Page Path' from the drop-down... This lets us use everything after
our website's domain for our matching condition. For this example, I'm going to leave the matching
as 'Contains', but you can choose from a range of options, including 'starts with', 'ends with',
and 'regular expression' matching. If you'd like to learn more about regular expressions,
I've included a link in the description below this video. Now we need to enter what we want
to match. I'm going to enter 'forward slash', 'thank', 'dash', 'you' which will mean we match
any pages on our website that contain this thank you page. Now I'm going to save the trigger...
This means our Google Ads conversion tag will only fire on our thank you page. Let's save the tag...
Okay, now that we've added a Google Ads conversion tracking tag to our website using
Google Tag Manager, let's use the same trigger to send a custom event to Google Analytics 4
(or GA4). In the first lesson, we added the GA4 configuration tag to Google Tag Manager,
so if you haven't added the configuration tag yet, then feel free to hit pause
and come back once you've watched the first lesson. Let's head back to Google Tag Manager...
We can see we already have our GA4 configuration tag. This is good because we will need this in a
moment. Now let's create a new tag... Let's name the tag 'Google Analytics GA4 Conversion'...
And let's select 'Tag Configuration'... We're going to choose 'GA4 Event' as the tag type...
And using the drop-down, we need to select our existing GA4 configuration tag...
Now we need to name our event. Google provides a list of recommended event
names to use, so for this example, I'm going to enter 'generate', 'underscore', 'lead'...
You can enter any event name you like, including any of Google's other recommended events,
or your own custom event name. You can also pass additional information with the event
using parameters and user properties, but I'm going to leave these options. So let's add
a trigger to our tag... Let's select the custom trigger we created for our thank you page...
This means our GA4 event tag will fire on our thank you page and we will be able
to configure the event as a conversion in Google Analytics. Now let's save the tag...
And let's create another GA4 event tag. This time we will create a tag that fires when someone makes
a product selection on my demo site. Let's head to the demo site to take a look...
My demo site has some products. Let's select a product... And we can see there is a drop-down
people can use to select a quantity. For our GA4 event tag, I want to know when
people make a selection using this drop-down. Let's right click to inspect the element...
And we can see that it has an ID of 'quantity', so we can use this to
configure our trigger in Google Tag Manager. Okay, lt's head back to Google Tag Manager...
Before we create the tag, we need to enable the built-in variables that
allow us to understand when someone makes a selection, so let's select 'Variables'...
And let's select 'Configure' for the built-in variables...
Now let's scroll down... And enable the 'Click ID' variable...
Now let's select 'Tags'... And create a new tag...
Let's name the tag 'Google Analytics GA4 Quantity Event'...
And let's choose 'GA4 Event' as the tag type...
Now let's enter 'select', 'underscore', 'item' as the event name... And let's create an 'Event
Parameter'... Let's name the parameter 'item', 'underscore', 'list', 'underscore', 'name'...
And let's click the icon to use a variable as the value...
Let's choose 'Click ID'... This will mean the value from the element's ID
will be used as the value for our event parameter. For our example, this will mean we send a value of
'quantity' to Google Analytics. Now we need to add a trigger... Let's create a new trigger...
And name the trigger 'Clicked Quantity'... Now let's select 'All Elements' as the trigger type...
And let's select 'Some Clicks'... Now we choose 'Click ID' from the drop-down...
Then choose 'Equals'... And enter 'quantity'... This means that our trigger will only match
when people click elements on our website with an ID of 'quantity'.
Now we can save the trigger... And we can save the tag...
We now have a GA4 event tag that will track when people view our thank you page,
and another event tag that will track people selecting a quantity using the drop-down selector.
Once you've added your new tags and triggers it's time to preview and test your changes.
We covered previewing and testing tags in the third lesson. If you need to re-watch the lesson,
you can find a link to it in the description below this video. When you're happy with your changes,
it's time to publish your container... To do this, we click 'Submit'... And then we
name the version of the container we're publishing. This should be something short
and descriptive... You can also add a description to document your changes in more detail...
When you're done, click 'Publish' to deploy the changes to your live website.
So that's how you can track conversions using custom triggers in Google Tag Manager. We
added a Google Ads conversion tag, and two custom GA4 event tags to our website. But
remember - you can use the same techniques to trigger any tags you like. In the next lesson,
we will cover more ways we can use custom triggers to fire our tags... You will
learn about tracking clicks, buttons, and forms using Google Tag Manager.
So if you haven't already, then please subscribe to my channel. I'll see you in the next video!