---
title: "Setting up referral links using Google Analytics (GA4)"
description: "This guide will walk you through how to create unique links for your affiliates/referrers to share so that you can track the performance, and reward them accordingly."
url: https://help.mayzing.com/en/articles/51-setting-up-referral-links-using-google-analytics-ga4
collection: "Analytics and Data Tracking"
updated: 2026-11-13
language: en
alternates: [vi, ar]
---

# Setting up referral links using Google Analytics (GA4)

This guide will walk you through how to create unique links for your affiliates/referrers to share so that you can track the performance, and reward them accordingly.

> **Info:** A pre requisite to this is setting up your Google Analytics for your store.

1.  To start with you need your store URL. For example [https://demostore.shop](https://demostore.shop/)
    
2.  Now to create a unique link for your affiliate/referrer you need to append the url with the code to make the URL unique.
    
3.  Example /?utm\_source=david&utm\_medium=referral&utm\_campaign=affiliate\_program
    
4.  Your URL will now look like this [https://demostore.shop/?utm\_source=david&utm\_medium=referral&utm\_campaign=affiliate\_program](https://demostore.shop/?utm_source=david&utm_medium=referral&utm_campaign=affiliate_program)
    
5.  Share this with your referrer.
    
6.  When they give this link to people, and it is shared and opened. It will track what the user has done, including things like;
    
    -   Page Views
        
    -   Add to cart
        
    -   Checkout
        
7.  To view the data, you need to go to your Google Analytics Dashboard.
    
8.  You can view the traffic in real time if you like by clicking on **Realtime Overview**
    
9.  Click on Active users by First User Source
    
    ![](https://staticfiles.gleap.io/attachments/20260430155856_5019.png)
    
10.  Then in **Event count by Event name**, click on **First Visit**.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_2649.png)
     
11.  This will drill in to the even parameters. Click on the next page icon to find source.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_5180.png)
     
12.  Click on **source**, and you will see the source of the traffic.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_6525.png)
     
13.  To look at Historical data, go to **Generate Leads > Traffic Acquisition.**
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_8667.png)
     
14.  Change the date in the top right to the date range you want to look at. **It is worth nothing here that traffic can take up to 24 hours to appear. So if you see nothing at first, you may want to check back tomorrow.**
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_3111.png)
     
15.  Click here and choose Session source/medium.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_4063.png)
     
16.  Now you will see the traffic that has hit your store.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_0092.png)
     
17.  If you want to check what the users have been doing, Under Event count, click the arrow and choose the events you want to look at.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_4377.png)
     
18.  For example here we have clicked **add\_to\_cart** and got back the following data. You can see a referral code of david has not generated an add to cart event.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_1812.png)
     
19.  If you want to look at purchase events. Click the Arrow under Key events, and then click **Purchase**.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_5209.png)
     
20.  You can see here, that the referrer david has not triggered any purchase events.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_6997.png)
     
21.  You are now set up, and can start tracking your events.
     
22.  You can create as many of these referral links as you want so if you have 100 referrers. Create 100 URLs by changing the word after utm\_source= for example;
     
     -   [https://demostore.shop/?utm\_source=david&utm\_medium=referral&utm\_campaign=affiliate\_program](https://demostore.shop/?utm_source=david&utm_medium=referral&utm_campaign=affiliate_program)
         
     -   [https://demostore.shop/?utm\_source=kate&utm\_medium=referral&utm\_campaign=affiliate\_program](https://demostore.shop/?utm_source=kate&utm_medium=referral&utm_campaign=affiliate_program)
         
     -   [https://demostore.shop/?utm\_source=brian&utm\_medium=referral&utm\_campaign=affiliate\_program](https://demostore.shop/?utm_source=brian&utm_medium=referral&utm_campaign=affiliate_program)
         
     -   [https://demostore.shop/?utm\_source=erin&utm\_medium=referral&utm\_campaign=affiliate\_program](https://demostore.shop/?utm_source=erin&utm_medium=referral&utm_campaign=affiliate_program)
         
23.  If you clicked on all of these you would see traffic coming through for each of the referrers.
     
     ![](https://staticfiles.gleap.io/attachments/20260430155856_4762.png)
