Affiliate for WooCommerce plugin helps you to add, manage affiliates, and track performance from a single place – commissions, sales, payouts, leaderboard, etc. Earn money without hard work. Increase your brand outreach, and get potential customers.
It’s common for store owners to use caching solutions to boost website loading times.
The Affiliate for WooCommerce plugin usually functions seamlessly with most caching plugins. However, in some instances, caching can cause the affiliate tracking to not work as expected, leading to lost commissions for affiliates.
Important
Make sure that the Affiliate for WooCommerce plugin is up-to-date (learn more). You can see the changes included in each update in the changelog.
Why does caching affect referral tracking?
↑ Back to topAffiliate referral tracking relies on cookies to track purchases through referral links or referral coupons.
Caching creates static versions of your web pages to speed up load times, but this can sometimes prevent dynamic features, such as cookie-based referral tracking, from working correctly.
So, when referral links or cookies are cached, registering referrals might fail.
If you encounter any such issues, you may need to make a few changes to your caching plugin setting to exclude specific pages and cookies from caching as mentioned below:
Excluding plugin URLs from caching
↑ Back to topIf the referral URLs are being cached, it may affect referral tracking, so we recommend excluding them from caching.
Also, we recommend excluding the following pages from caching, and script loading:
- Affiliate landing pages
- Affiliate registration form page
- A custom page containing the affiliate dashboard
- Affiliate referral URLs
Excluding Affiliate for WooCommerce cookies from caching
↑ Back to topThe Affiliate for WooCommerce plugin relies on cookies for referral tracking. It saves the cookies in the visitor’s browser when someone visits an affiliate referral link or applies a referral coupon.
Please refer to this FAQ to learn more about the names and the purposes of the cookies.
If these cookies are being cached, it may result in disabling referral tracking, so we recommend excluding them from caching.
How do we exclude the URLs and cookies from caching?
↑ Back to topExcluding URLs and cookies from caching depends on which caching plugin you use.
WP Rocket
↑ Back to topFollow these steps to exclude a page(s) from the cache.
- Go to WordPress admin > Settings > WP Rocket > Advanced Rules tab.
- Find the box ‘Never Cache URL(s)’.
- Add the URLs as guided in the WP Rocket documentation.
- Save the settings.
To exclude the cookies, follow these steps:
- Go to WordPress admin > Settings > WP Rocket > Advanced Rules tab.
- Enter the cookies mentioned above inside the box Never cache Cookies.
- Save the settings.
LiteSpeed Cache
↑ Back to top- Go to WordPress admin > LiteSpeed Cache > Cache > Excludes tab.
- In the ‘Do Not Cache URIs’ field, add the slugs to exclude URLs.
- In the ‘Do Not Cache Cookies’ field, add cookie names.
- Save the settings.
- Purge all caches.
W3 Total Cache
↑ Back to top- Go to WordPress admin > Performance > Page Cache > Advanced tab.
- In the ‘Never cache the following pages’ field, add the slugs to exclude URLs.
- In the ‘Rejected cookies’ field, add cookie names.
- Save the settings.
- Purge all caches.
WP Fastest Cache
↑ Back to top- Go to WordPress admin > WP Fastest Cache > Exclude tab.
- Add a new rule to exclude URLs.
- Add a new rule to exclude cookies and enter cookie names.
- Save the settings.
- Clear all caches.
NitroPack
↑ Back to top- You can exclude URLs by following this doc.
- You can exclude from optimization by Cookie by following this doc.
For more information, please refer to the documentation of your specific caching plugin.
Excluding Cookies on the Hosting Side
↑ Back to topSome server-side caching systems or CDNs might cache cookies or not properly handle dynamic content (like referral tracking). In such cases, you need to whitelist the cookies in the hosting environment.
Also, if your hosting provider uses Varnish Cache or a similar system, they may need to ensure that referral cookies are not cached, which can be done by adding custom rules or settings.
If you’re unsure, contact your hosting provider and ask them to whitelist affiliate tracking cookies or ensure that dynamic content (like referral tracking) is served correctly.
Hosting-Specific Notes
↑ Back to topSome hosting providers have stricter caching rules. For example:
- Cloudflare: Use “Page Rules” to bypass caching for referral URLs and registration pages.
- Managed WordPress Hosting (e.g., Kinsta): Contact support to exclude referral tracking cookies from caching.
Final Tips
↑ Back to topCaching levels: Some plugins offer different caching levels (e.g., page cache, object cache). Ensure you’re excluding data at the appropriate level.
Advanced caching rules: Caching plugins might offer advanced options for more granular control. Refer to your plugin’s documentation for details.
Change cookies names: If you need to change cookie names to support any specific web hosting (for example, Flywheel hosting), or anything else, you may check this FAQ.
Testing: After implementing changes, test your affiliate tracking functionality to ensure proper referral attribution.
Regular update: Regularly update your caching plugin’s settings when changes are made to your referral structure.
Hosting provider: Contact your hosting provider for assistance if cookie whitelisting is required.
By following these simple steps, you can ensure that your affiliate program runs smoothly without interference from caching mechanisms.
FAQs
↑ Back to top1. What to do if all the visitor’s IP address is the same as your hosting’s IP address?
↑ Back to topIf you use Varnish cache or a similar system, it listens on port 80 and passes data to the default HTTP application; it means that the HTTP log files will show your server’s IP instead of the actual remote IP of the visitor.
Visit this doc to learn how to pass a visitor’s IP address from Varnish/similar system to WordPress, so the actual IP address of the visitor is recorded.
Facing any issues?
↑ Back to topFeel free to contact your hosting provider or us from here for assistance.
Feature request
↑ Back to topHave a feature request or enhancement suggestion for Affiliate For WooCommerce? Submit it from here: Submit a feature request.