Affiliate links are often masked as internal links by webmasters for natural linking. What I mean is, say Amazon India homepage link as an affiliate link is of the form:
But, I can mask it as
or
or even
So to track such masked links, external link tracking tag won’t work. We have to use a separate trigger to track affiliate links via Google Tag Manager in Google Analytics.
So let’s begin.
You should be aware of Google Tag Manager Lingo. Moreover understand what a trigger, tag, and the built-in variables available are.
The next is, you should have a Google Tag Manager for tracking site’s traffic in Google Analytics though it isn’t a must. We will still need to have the Google Analytics Property ID to send link clicks data to Google Analytics.
If you aren’t sure, refer to my article – How to Connect Google Analytics With Google Tag Manager first and then continue with this article.
Also, I assume some affiliate links are already masked and placed on a website or blog.
If you are not masking affiliate links with prefix like /go or /r, one has to configure the trigger with a regex table. If you are using masked affiliate URLs with a prefix, you can move directly to step 2.
Create a new User Defined Variable.
Note: Under Advanced Settings, make sure the “Ignore Case” is check. “Full Matches Only” and ” Enable Capture Groups and Replace Functionality” both are unchecked.
You have to add each url you want to track for clicking in the RegEx table.
Tip: If you have many links, you can add them once and create the trigger. From now on, create new links as masked with a prefix like /go or /r.
Now we will create the trigger as follows:
So the trigger will fire when the variable we defined in the previous step has “true” as the value.
Event Tracking Parameters
The trigger for this tag will be how you have masked links with a prefix or without a prefix.
If you are using without prefix links till date and now want to use mask links with a prefix, create both the tags.
Log in to your Google Analytics account and locate the Affiliate Link Clicks event under Behavior > Events > Overview.
Event action will list all the Page URLs which are getting the affiliate links clicks. We have mentioned it in the event tracking parameter called the Action.
Similarly, event label will list all affiliate URLs that are getting the clicks.
One can track the best performing affiliate programs. However, one can also find affiliate links which drive clicks but doesn’t generate enough revenue as well.
Free Google Ads Tutorial for an absolute beginner covering campaigns and their types, networks, keywords,…
Do you want to make money programming in Java? Here are 6 creative ways for…
9 smart ways for freelancers to achieve financial freedom. First, you have to believe it…
With so many programming languages and resources available, it can be information overall to learn…
Wise review from an Indian freelancers point of view to receive payments in India. How…
There are 3 types of clients who want you to lower the price. How to…