Set up referrals
In this help article, you'll learn how to set up referrals for your checkout, so that when someone makes a purchase, you'll know whose link they used.
Add a field for your referral
To enable referrals, you need to add a hidden field to your one page checkout.
- Open your Checkout Page dashboard and click on the checkout you'd like to edit
- Head over to Fields and click to Add custom field
3. Type Referral
into the Label and Placeholder fields
![image-15d6.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2Fdf59cb6429217665e927500ff9604eff343d2fbc-1300x886.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
4. Open Additional Settings and check Hide field
![image-6c6e.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F73d25ac6ed2c98e9399ba2028a3108d2af3e6661-1136x1374.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
5. Save your changes 6. You can drag/drop the field to order the information on your payment page
![image-39ed.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F11d0c90bce290a187cc591c28e978a9259b54f00-1128x1202.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Create a referral link
Now you can create referral links and share them with your customers.
Example:
- https://checkoutpage.co/c/business-name/referral=name
There is no limit to the number of links you can create.
Test payments
Let's use this referral link as an example:
- https://checkoutpage.co/c/business-name/referral=name
To make sure everything is working as expected, make a test payment from Checkout Page after setting up the hidden field.
- Open your Checkout Page dashboard and click on the checkout you'd like to edit
- Click Test payments on the top right
3. From the Preview dropdown, click Payment link to open a payment link in a new tab
![image-0045.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2Fb081f62466eaee783a7ea688278916bcf90b839f-2858x928.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
4. Switch to the new tab and edit the end of the URL in the address bar to end testing=true&referral=name
as per the example referral link
![image-a91d.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2Ffbcd89916371cdf8f09c6dcee14948ff188d2d8b-2850x916.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
5. Refresh the page to see if your hidden field is prefilled and complete all the checkout fields
![image-f48c.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2Fbf748c87e4f9a6305fc04cea0a7aa17ceea4f7d0-2874x1324.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
6. Use the test card details found on the Test payments page to complete the card field
![image-edfc.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F61ebee2953f1989f4d332b20d5f9b19abd5f7ddb-2874x1324.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
- You can leave the Postal code field empty
![image-f976.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F142c504824614b1759516e372eb944962b1c451a-2856x1198.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
Learn more about test payments here
View referral data
After someone made a purchase (real payment) using one of the referral links, you can find the referral ID on the Payments tab.
- Open your Checkout Page dashboard and go to the Payments tab
- Click on the payment and scroll down to find Referral under Fields
![image-defc.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F029c76debdcbef2d160a27d427f304c17ce1e96e-2842x1250.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
For test payments:
- Open your Checkout Page dashboard and click on your checkout
- Go to the Test payments tab and scroll down to Test payments section
3. Click on your test payment to view data and scroll down to find Referral under Fields
![image-d8c7.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2Fbe1651d9b8876661a433dda53113c4c855316091-2848x1140.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
![image-b59a.png](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2F1n2jytol%2Fproduction%2F029c76debdcbef2d160a27d427f304c17ce1e96e-2842x1250.png%3Fw%3D1536%26fit%3Dmax%26auto%3Dformat&w=3840&q=75)
You could also set up a zap to push the referral data to a CRM or spreadsheet where you could view and filter it by each referral.
Conditions
Checkout Page doesn't store a cookie for referrals meaning each referral is only valid for one session.
To keep earning referrals, the referral link must be used every time making a purchase.