This page explains how referral links work: what they look like, which page they open, and how the plugin remembers the referral until the friend buys.
What a referral link looks like
Every advocate has a referral code that starts with ref followed by 7 digits, such as ref1234567. Their link is a page on your site with the code added:
https://example.com/?raf=ref1234567
The ?raf= part is what tracks the referral. Any page on your site works, as long as the link keeps ?raf= and the code, for example https://example.com/shop/?raf=ref1234567.
Customers find their link in My Account → Refer a Friend, on product pages, on the order received page and in emails, depending on your Display settings.
Choose the landing page
By default, links open your homepage. To send friends to a different page, such as your shop or a page explaining the offer:
- Go to WooCommerce → Refer a Friend → Settings → Display Settings.
- Enter the full address in Referral landing page, for example
https://example.com/shop/. - Click Save.
This page is also used for the Shop Now button in the coupon emails.
Two exceptions:
- Links in the product page Refer a Friend tab always point to that product.
- A shortcode with a
urlattribute uses that address. See Shortcodes.
How the referral is remembered
- The friend opens the link.
- The plugin’s JavaScript saves the code in a cookie named
gens_rafin the friend’s browser. - The friend can browse, leave and come back. The referral is remembered for Cookie Time days, which is 7 by default.
- At checkout, the plugin reads the cookie, applies the friend discount and saves the referral on the order.
- With Delete Cookie after Purchase on, the cookie is removed after the order.
If the friend opens a second advocate’s link, the newer link replaces the older one. The last link clicked gets the credit.
What can break tracking
- Redirects that drop
?raf=. For example, fromhttptohttps, fromwwwto the bare domain, or a landing page plugin. Open the link in a private window and look at the address bar once the page loads. - Delayed or blocked JavaScript. The cookie is set by JavaScript. Exclude
gens-raf-public.jsand jQuery from “delay JavaScript” options in caching plugins. - Cookie consent tools that block cookies until the visitor accepts. Mark
gens_rafas a functional cookie. - Different devices or browsers. The cookie lives in one browser. If the friend opens the link on their phone and buys on a laptop, the referral isn’t tracked. Referral codes typed at checkout work across devices.
See Known compatibility issues for specific plugins.
Check it worked
- Open an advocate’s link in a private window.
- Open your browser’s developer tools and look under Application → Cookies (Chrome) or Storage → Cookies (Firefox). There should be a
gens_rafcookie containing the code. - Add a product to the cart. The friend discount should be applied.