Every effort we do to grow your blog should be measured. Only by doing that we could know what works and what doesn’t.
At the beginning of September 2015, I place a big banner about a competition with a total prize of Rp.500.000,- on dUS Indonesia. The banner itself has the purpose of attracting people to the dUS forum. The problem is I don’t know how well the banner works. I don’t know how many people clicking the banner.
Why is the data important?
Because if many people click the banner, that means it works well, if not, then I have a problem. With the data, I can figure out which area that needs to be fixed.
The question: How to track the number of click on a banner?
The answer is: Google Analytic event tracking.
Generally, event tracking is used to monitor the click activities. It can also be used for other things, but in this article I’m focusing only on the click tracking.
How to activate Google Analytic event tracking
You can place the script, either between the <head> tag , before the </body> tag or between the <footer> tag.
Some of the WordPress themes have the feature to make the script implementation easy. If your theme doesn’t support it and you don’t understand how to edit your theme, you might want to search for a plugin that can do it.
The tracking code format
ga('send', 'event', 'CATEGORI', 'ACTION', 'LABEL', VALUE);
You combine the above code with the <a> tag + onclick, for example:
<a href="http://dapur-uang.com/forum" onclick="ga('send', 'event', 'CATEGORI', 'ACTION', 'LABEL', VALUE);"></a>
When you click an image(banner) or a link covered with an <a> tag, thus the tracking will be fired. I’ll give two examples, but before we go there I want to explain about the CAPITAL letters on the code. You have to change them according to your need. The explanation:
For example, there are two different banners on your blog and on each of them you place a tracking. Both of them are banners related to a ‘Forum’, thus you may group them into a ‘Forum’ category.
If you just use one banner, then just give it any suitable category name.
You define the action that you want to track. In this case, you may give it a ‘Click’ name.
Let’s say there are two banners, and you want to monitor the performance of each of them. You may give them a name for example ‘Banner-top’ and Banner-bottom’. That way you can see the report of each banner.
- VALUE (Optional)
There’s certain case, you might want to give a monetary value on the click.
The purpose of assigning names is so the data on the Google Analytic report can be grouped based on category, action and label, and money value (if you assign one).
If you search on Google or watch Youtube videos, you may find the following code format:
onclick="_gaq.push(['_trackevent', 'KATEGORI', 'ACTION', 'LABEL', VALUE]);"
This is an old code that doesn’t work anymore. Don’t use it.
Now, here are the examples how to use the <a> tag and the tracking code
An example of implementing tracking on a banner
a href="http://dapur-uang.com/forum" onclick="ga('send', 'event', 'Forum', 'Klik', 'Banner1');"> <img src="lokasi URL gambar Anda" /> </a>
An example of implementing tracking a link
<a href="http://dapur-uang.com/forum" onclick="ga('send', 'event', 'Forum', 'Klik', 'Cara Tracking');"> Hai ini link loh </a>
Testing the tracking
If you just click the banner or the link with your browser, even when the tracking were triggered, the data won’t be recorded. Because Google knows it’s you. So you won’t be able to see it on your Analytic report – Reporting > Behavior > Top Event to make sure it works
To solve this, there are two options you can choose:
- You can use the Chrome extension: Event Action Tracker made by Pete Milkman. With this extension, if you click on the tracked banner, thus you should see the tracking is fired.
Hopefully with this information you’ll be able to measure things you put on your blog, either it’s a banner or an affiliate link.
Tell me how you use this knowledge? What benefit you gain? Please comment below.