Referral Attribution Rules and Edge Cases
Understand how referral links and referral coupons are attributed, awarded, and protected from self-referrals.
Applies to 1.2.2+
Stable
Verified July 29, 2026
WooCommerce Loyalty supports referral attribution from token links and generated referral coupons. These two flows share the same order referrer metadata, but coupon attribution takes priority when a referral coupon is used.

Referral Link Attribution
- Referral links use the
refquery parameter, such as?ref=TOKEN. - When the token matches a customer referral token, the plugin stores the referrer user ID in the
yowcl_refcookie. - The cookie lifetime is 30 days.
- During checkout, the cookie referrer is copied to order metadata.
- Referral link rewards are evaluated when the order reaches completed status.
Referral Coupon Attribution
- Referral coupons are generated for customers when referral coupon settings are enabled.
- When a referral coupon is applied, the plugin validates the coupon owner.
- The coupon owner cannot use their own referral coupon.
- The coupon owner is stored in WooCommerce session data and then copied to order metadata during checkout.
- Referral coupon reward points are awarded when the completed order is processed.
Precedence Rules
| Situation | Result |
|---|---|
| Order has a referral coupon | Coupon attribution is used and link attribution is skipped for that order. |
| Order has only a referral link cookie | Link attribution can award both referrer and referee if settings allow it. |
| Purchaser is the same user as the referrer | The reward is skipped or the coupon is rejected as self-referral. |
| Guest order from referral link | Link referral rewards are skipped because the referee must be a registered purchaser. |
| Referral settings have no points for the referrer role | No reward is awarded, and the order may remain unmarked for that skipped flow. |
Common Troubleshooting Checks
- Confirm referral link or referral coupon settings are enabled.
- Log in as the referrer and confirm the referral token or coupon exists.
- Visit the referral link in a clean browser session and confirm checkout happens within 30 days.
- Complete the order as a different registered customer when testing link rewards.
- Move the order to completed status and check the points history for referral action labels.
- For coupon tests, confirm the coupon owner is not the same as the checkout user.
What To Capture For Support
- Referrer user ID and referee user ID.
- Referral link URL or coupon code used for the test.
- Order ID and final order status.
- Screenshot of referral settings.
- Filtered points history rows for the order.
Continue from WooCommerce Loyalty Points & Rewards documentation to the complete product workflow.
Evaluate product scope on the money page, use the pillar Guide for decisions and trade-offs, and return here for exact configuration.
Did this guide answer your question?
Still stuck?
Open a support request and include this article title, your plugin version, and what you already tried.
Open Support