Common questions on affiliate tracking

Tracking referrals and commissions accurately is at the heart of any affiliate program, and AffiliateWP ensures this is handled seamlessly. Below, we’ve answered some of the most frequently asked questions regarding affiliate tracking in AffiliateWP.

How Is an Affiliate Tracked?

Affiliates are tracked when they promote your products and services using a referral URL, such as:
http://yoursite.com/?ref=123.

When a customer clicks on this link, the affiliate’s ID (e.g., 123) is stored in a cookie within the customer’s browser. If the customer makes a purchase, the affiliate linked to that referral URL is awarded a commission for the sale.

Is the Affiliate Tracked Across All Pages of the Site?

Yes, affiliates are tracked across all pages of your site as long as the visitor’s browser retains the tracking cookie. When a customer clicks on an affiliate’s referral link, the affiliate’s ID is stored in a cookie in the customer’s browser. This cookie ensures that the affiliate remains tracked regardless of which page the customer navigates to on your website.

If the customer makes a purchase or completes a conversion action on any page of your site during the cookie’s active period, the tracked affiliate will receive the commission associated with that action.

Can I Change the ?ref=123 to Something Else?

Absolutely! You can change the referral variable from AffiliateWP » Settings » Affiliates » Referral Variable. For more details, see our AffiliateWP settings documentation, which outlines all variations of referral URLs affiliates can use.

The cookie duration is determined by the Cookie Expiration setting, which you can configure under AffiliateWP » Settings » Commissions » Cookie Expiration. By default, it’s set to 1 day, but you can change this to any desired number of days.

Keep in mind that customers can clear their browser cookies at any time, which will remove the tracking information.

The first affiliate link clicked will store the affiliate’s ID in the cookie. This cannot be overridden by a second link unless:

  • The cookie expires.
  • The customer clears their browser cookies.
  • The Credit Last Referrer option is enabled under AffiliateWP » Settings » Commissions.

While you can set the cookie expiration to an extremely high value, this doesn’t account for customers clearing their browser cookies or using a different browser. For a more reliable solution, the Lifetime Commissions addon links customers permanently to affiliates after their first referral, regardless of browser or cookie status.

Why Aren’t Referrals Being Created?

Referrals may not be created due to JavaScript errors preventing the tracking cookie from being stored. To troubleshoot:

  1. Check for JavaScript errors in your browser’s console.
  2. Switch to a default WordPress theme (e.g., Twenty Twenty-One) to see if the error is theme-related.
  3. Temporarily deactivate all other plugins to rule out conflicts.

If JavaScript errors persist, you can enable Use Fallback Referral Tracking Method under AffiliateWP » Settings » Advanced as a temporary workaround. However, fixing the errors should be your priority.

Can Affiliates Credit the Last Referrer?

Yes, enabling the Credit Last Referrer option under AffiliateWP » Settings » Commissions ensures the last affiliate link clicked takes precedence.

What Happens if a Customer Uses an Affiliate-Tracked Coupon?

If a customer uses a coupon assigned to an affiliate, the coupon takes priority. The affiliate linked to the coupon will receive the referral, even if another affiliate’s link was clicked beforehand.

Can Affiliates Refer Themselves?

Yes, but this requires the Allow Own Referrals addon. This add-on enables affiliates to earn commissions on purchases made using their own referral link or coupon code.


That’s it! AffiliateWP’s robust tracking system ensures affiliates are accurately credited for their referrals, using cookies to maintain tracking across all pages of your website. While the default tracking is reliable, understanding these nuances can help you troubleshoot issues and optimize your program for maximum effectiveness. For advanced needs like lifetime tracking, addons such as Lifetime Commissions offer additional flexibility.