0

Yesterday I got 200+ link clicks on the affiliate dashboard, it only shows around 30 clicks on analytics. I did the setup via tag manager for link click tracking and want to track affiliate link clicks as goals in analytics correctly.

The affiliate platform shows a lot more clicks and analytics is tracking only a few. I have three affiliate links in every post on the blog that I want to be tracked when someone clicks on them.

For e.g: https://www.spiritual-galaxy.com/angel-number-192/ , there are 3 affiliate links here, attaching the screenshots.

Screenshot - Affiliate Link 1

Screenshot - Affiliate Link 2

Screenshot - Affiliate Link 3

Attaching the screenshot for GTM settings.

Screenshot GTM

Attaching the screenshot for tracking event (affiliate link click) as a goal on analytics.

Screenshot - Track Event

Rhythm
  • 41
  • 6

1 Answers1

0

GTMs click events can be challenging, and you get no data until it hits GA.

I would use the outbound clicks listener and manage rules inside of ListenLayer for what defines an affiliate link. It will then give you reporting on your click events directly so you will be able to see that compared to GTM.

Step 1: Create an account, get your script and place it on your website via GTM. Then turn on the Outbound Clicks Listener and it's Activity Features on the feature screen. enter image description here

Step 2: Publish your changes and preview your website in GTM. Click on your affiliate links and you will see an outboundClick event pushed into the data layer for each click. enter image description here. You can see here there are a ton of pieces of info that are really useful. Each row is a unique element of that click event and you can use them to customize your affiliate click data layer activity for better tracking.

Step 3: Let's identify your affiliate links via ListenLayer with some rules. The issue is that the Listener is going to capture all Outbound Clicks, and I'm assuming you might have some that are NOT affiliate links. You can also use the following process to categorize your affiliate links with a lookup table so you can actually segment which ones are receiving clicks!

Turn on the Custom Data Layer Feature under the Outbound Clicks Features screen. Then create a new data layer variable under Global Custom Data Layer Variables enter image description here I'm creating one called affiliateClick. I am going to write some rules to push "yes" into this variable in my data layer whenever an affiliate link is clicked!

Step 3: Inside my Outbound Clicks Listener navigation, I will select Custom Values. Then create a Lookup Rule. We're going to use some values in our automatic data layer to determine if a click is an affiliate click. You can see in step 3 I would recommend just using a variable and selecting from this list.
enter image description here For example, maybe you use hostname because you know all the website domains you will link to that are affiliate. Or you could add a URL parameter to all affiliate links and target that in the click event. I'm going to select Hostname. On the next step, select to define a value for the variable we created in step 2. enter image description here Then click save and manage values.

Step 4: A table will be generate and you can insert rows. Each row is a rule, read top to bottom and it stops when a match is found. Here are my rules, your affiliate domain is at the top and I have some fake examples of others. You can see how you could also name or categorize these with this rule. At the bottom I have a catch all "no". enter image description here

Save and publish your changes.

Step 5: Now your outbound clicks that are affiliate links will have this clear "Yes" value in the data layer enter image description here So instead of trying to use GTM to target some crazy xpath value, you can simply target event = outboundClick and clickCustomValues.affiliateClick= yes for a trigger that will universally capture your affiliate links. Now, if you wanted to you could get super fancy and categorize your affiliate links and pass them into GTM with a variable and pass that to GA with every event - all dynamically.

I'm sortof assuming you know GTM pretty well but basically you just need to be able to create Custom Event triggers based on the event name in the data layer outboundClick and capture data layer variables. If you need help with just reading and using data layer activity in GTM, there are probably a ton of details in other answers on stackoverflow.

screen1
  • 54
  • 1