Button Tracking With Google Tag Manager.
Today you will be reading our no-nonsense guide into tracking button tracking with Google tag manager. Let’s amuse you know a little bit about both; tag manager & and websites.
What Will I Need To Get Started?
- A button to track, This will need to contain a html ID attribute. find out more
- Tag Manager installed on your website
- A Google ad’s account
Locating Your Button
First, lets go to the website where the button is located. Here you can see the magic button in its natural habitat.
Using google chrome or any another ‘modern’ browser right click on the button and click inspect.
A window will appear with some scary code. Your job is to locate the button so we can select the ‘ID’ attribute. If you are using Chrome, the code you clicked will automatically highlight for you.
As mentioned before, your looking for a ‘ID’ attribute. In our case our ID is ‘clickme’ save this for later.
Setting Up Google Tag Manager
In Google tag manager we need to enable a variable so we can pick up this ID.
Open up Google tag manager.
Locate variables on the right hand side.
Make sure that you have enabled ‘Click ID’ this will allow us to select our ‘clickme’ ID using Google tag manager.
Set Up Your Conversion Action
For this part of this guide, you will need to setup a google ad’s action. We will assume your capable of doing this. Make sure you save the conversion ID and label, we will need this later.
Setting Up Your Triggers.
Now we need to tell tag manager to listen to all clicks on our button. Here we will be using the ID attribute we saved at the start of this post. Go to Triggers page in tag manager and lets create a new new trigger. Give your trigger a name, i will call mine ‘Magic Button’
Lets click ‘All elements’ then configure our ID attribute into here.
Here we configure our trigger to fire on a ID attribute that contains ‘clickme’ You can save this.
Setting Up Your Tag.
This is the last step! We need to link the trigger with a tag that will fire our google ads conversion. Open up the tags page & lets create a new tag, call it whatever you want.
Make sure you select the trigger we made previous to this. Then lets configure our tag
That’s it! Save this & run in preview and your tag will fire when you click your button!