A step-by-step guide
The tracking of external links (outbound links) is integrated in Google Analytics 4. The corresponding event is called"click" - this is triggered for all outbound links. If you only want to see the actual affiliate links in a report, you need to set up a special event with the corresponding parameters. This is possible both directly in the GA4 property and via the Google Tag Manager. The second option is more flexible and can be used if many unique affiliate domains are in use. If one or two domains are involved, it is sufficient to set this up directly in the configuration of the GA4 property.
In this article, we look at examples of (fictitious) affiliate links from amazon.de and otto.de - the aim of the report is to see how often these links are clicked on by website visitors, which URL it is exactly and on which of our subpages the clicks occur.
First of all, check whether the "Outbound clicks" option is activated for the web stream in the Optimized analyses section. The option is activated when the GA4 property is first set up. If this is not the case, you can simply activate it!
The way to the setting: Administration > Data streams > "Your stream name" > Events [Optimized analyses] > Click on gear > "Click on external links".
This method is well suited if only a few different affiliate partners are linked on the website. If there are many different affiliate domains, tracking should be controlled via the Google Tag Manager, see option 2.
Tip: You can copy existing events. To do this, open one of the events and click on COPY in the three-dot menu at the top right.
How to use the event in the evaluation is explained below.
The prerequisite is, of course, that the tag manager is implemented correctly.
All domains used in the affiliate links can now be listed and separated using the pipe |. In the example above, the trigger fires when a user clicks on a link that contains "amazon.de" or "otto.de" in the URL. This allows you to address five or 25 domains whose click triggers this trigger. Now the new event "affiliate_link_click" just needs to be forwarded to Google Analytics 4. This is done with the tag.
After the setup, whether using option 1 or 2, and the successful tests, you have to wait 24 hours. Only then will the new event be available in the reports. The next day, create a new report in the "Explore" area and select the following dimensions and measured values:
All events are now displayed. The new event "affiliate_link_click" must therefore be set as the final action at the bottom of the filter.
This completes the report and provides the number of clicks on the affiliate links, their URLs and the URL of your own website on which the affiliate link was clicked for the selected time period.
GTM, Google Analytics 4, events, parameters, DebugView - it's easy to lose track. As an SEO agency and Google Premium Partner, we are happy to support you with the setup, configuration and tracking extension as well as the creation of corresponding reports in GA4 or Google Looker Studio.