This post contains affiliate links.
On The Bloggers Blog, discover exactly which blog posts are making you money with this step-by-step, code-free guide to setting up Google Analytics 4 and tracking your affiliate clicks like a pro.
Let’s be entirely honest: when Google retired Universal Analytics and forced everyone onto Google Analytics 4 (GA4), the blogging community collectively groaned. Universal Analytics was intuitive; GA4 feels like a platform built by data scientists, for data scientists.
If you are a non-techie blogger, logging into GA4 can feel like looking at a cockpit dashboard. You just want to know two simple things: Where is my traffic coming from? and Which affiliate links are they actually clicking?
Tracking affiliate clicks is the ultimate cheat code for blog monetization. It tells you exactly which blog posts are your money-makers and which ones need optimization.
The good news? You don’t need to know a single line of code to set this up. This step-by-step guide will walk you through setting up GA4 and tracking your affiliate clicks without breaking your website.



Step 1: The Painless GA4 Setup (If You Haven’t Already)
Before we can track clicks, we need to ensure GA4 is accurately collecting baseline data from your site. If you already have GA4 installed, you can skip to Step 2. If not, let’s get it done in three minutes.
- Create your property: Go to Google Analytics and sign in with your Google account. Click the Admin gear icon in the bottom left corner, then click Create Property. Enter your blog’s name, select your timezone, and choose your currency.
- Set up your Web Stream: Select Web as your platform. Enter your blog’s exact URL (e.g.,
thebloggersblog.co.uk) and give the stream a name like “My Blog”. - Keep Enhanced Measurement ON: You will see a toggle for Enhanced Measurement. Ensure this is enabled. By default, GA4 automatically tracks basic things like page views, scrolls, and—crucially for us—outbound clicks. Click Create Stream.
How to Add the Code Without Touching Your Theme
Google will provide you with a Measurement ID (it looks like G-XXXXXXXXXX).
Do not paste this directly into your WordPress theme files—if your theme updates, your tracking breaks. Instead, install a lightweight, free plugin like Insert Headers and Footers (WPCode) or use a dedicated SEO plugin like Rank Math or Site Kit by Google. Simply paste your Measurement ID into the designated Google Analytics field in the plugin settings, click save, and your setup is complete.
Step 2: The Magic of “Outbound Clicks” in GA4
Here is a bit of great news: because you left Enhanced Measurement turned on during setup, GA4 is already tracking every time a reader clicks a link that takes them away from your website. In GA4 language, an affiliate link click is simply an “outbound click.”
However, out of the box, GA4 aggregates all outbound clicks into one massive, confusing pile. It doesn’t automatically show you a clean report saying “User clicked your Amazon Affiliate Link on Post X.”
To see that data, we need to look at the event parameters. When someone clicks an outbound link, GA4 quietly records a few extra pieces of information:
click_url: The exact destination URL they went to (e.g., your affiliate link).link_classesorlink_id: Helpful identifiers if you use specific button styles.
To view these raw clicks right now, go to Reports > Engagement > Events. Look for the event named click. This represents every single outbound link clicked on your site.
Step 3: Turn Outbound Clicks into Clear Affiliate Data
To make this data useful for your business, you need to tell GA4 to separate your generic outbound clicks (like a link to a news source or a friend’s blog) from your revenue-generating affiliate links.
There are two primary ways to handle this depending on how you manage your blog.
Scenario A: You Use a Link Cloaking Plugin (Recommended)
If you use a WordPress plugin like Pretty Links or ThirstyAffiliates, your affiliate links likely look like internal links. For example: thebloggersblog.co.uk/recommend/bluehost.
Because these links contain your own domain name, GA4 does not count them as outbound clicks automatically. To fix this, we create a Custom Event inside GA4:
- Go to Admin > Data Display > Custom Definitions.
- Click Create custom dimensions.
- Name your dimension “Affiliate Click”.
- Set the Scope to Event.
- In the Event Parameter dropdown, type or select
click_url. Click Save.
Now, GA4 knows to specifically listen for the destination URLs of those clicks.
Scenario B: You Use Raw Affiliate Links (Amazon, ShareASale, etc.)
If you paste raw links directly (like amzn.to/XYZ), GA4 already sees them as outbound clicks. To find them easily without wading through noise:
- Go to Explore in the left-hand menu and start a Blank Exploration.
- Add Dimension:
Link URL(orclick_url) andPage path(to see which post drove the click). - Add Metric:
Event count. - Drag these into your report row and values, and filter the report to only show events where the
Link URLcontains words like “amazon”, “shareasale”, or “awin”.

Step 4: Building Your “Money Post” Report
Data is completely useless unless it helps you make decisions. Once your tracking has been active for 24 to 48 hours, it is time to build a custom dashboard that shows you exactly which blog posts are making you money.
Follow this exact blueprint in the GA4 Explore tab to build your “Affiliate Performance Dashboard”:
[Dimensions] -> Select "Page path + query string" AND "Link URL"
[Metrics] -> Select "Event count"
[Rows] -> Drag "Page path + query string" here
[Columns] -> Drag "Link URL" here
[Values] -> Drag "Event count" here
What this report tells you: The rows show your specific blog post URLs. The columns show the exact affiliate links clicked. The numbers tell you exactly how many times readers clicked through.
If you see a post getting 10,000 visitors a month but generating only 2 affiliate clicks, you instantly know your call-to-action (CTA) is broken. Conversely, if a low-traffic post with only 200 visitors is generating 50 clicks, you know you need to drive more traffic to that specific post immediately.
Troubleshooting: Why Aren’t My Clicks Showing Up?
If you don’t see data immediately, do not panic. GA4 is notoriously slow at processing data. It typically takes 24 to 48 hours for standard data to populate in your reports.
If you want to test if it’s working right now, use the DebugView:
- Go to Admin > Data Display > DebugView.
- Open your blog in a separate browser window or incognito tab and click one of your affiliate links.
- Look back at the DebugView timeline. Within a few seconds, you should see a green or blue
clickevent pop up. Click on it to verify that theclick_urlmatches the affiliate link you clicked.
Action Plan: Your Next Steps
Setting up GA4 tracking might feel like a chore, but it shifts you from “guessing” what works to “knowing” what works.
To make this stick, follow this quick checklist today:
- [ ] Verify your GA4 Measurement ID is successfully installed via a trusted plugin.
- [ ] Check that Enhanced Measurement is active in your Web Stream settings.
- [ ] Wait 48 hours, then build a basic Exploration report to track your outbound URLs.
- [ ] Pinpoint your top 3 most-clicked affiliate links and optimize those specific posts with better formatting or bonus offers to boost your conversion rates even higher.
