1. Documentation /
  2. Affiliate For WooCommerce /
  3. How does Affiliate for WooCommerce plugin work with caching

How does Affiliate for WooCommerce plugin work with caching

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, referral/visitor tracking issues may arise in some instances.

If you encounter any such issues, you may need to make a few changes to your caching plugin settings.

Excluding plugin URLs from caching

↑ Back to top

If the URLs are being cached, it may result in disabling visitor and referral tracking, so we recommend excluding them from caching.

We recommend excluding any page URLs like the following from caching, and script loading:

Excluding Affiliate for WooCommerce cookies from caching

↑ Back to top

The Affiliate for WooCommerce plugin creates the following cookies (visit this FAQ to learn more):

  1. affiliate_for_woocommerce
  2. afwc_hit
  3. afwc_campaign

If these cookies are being cached, it may result in disabling visitor and referral tracking, so we recommend excluding them from caching.

How to exclude the URLs and Cookies from caching?

↑ Back to top

Excluding URLs and cookies from caching depends on which caching plugin you use.

WP Rocket

↑ Back to top

Follow these steps to exclude a page(s) from the cache.

  1. Go to WordPress admin > Settings > WP Rocket > Advanced Rules tab.
  2. Find the box ‘Never Cache URL(s)’.
  3. Add the URLs as guided in the WP Rocket documentation.
  4. Save the settings.

To exclude the cookies, follow these steps:

  1. Go to WordPress admin > Settings > WP Rocket > Advanced Rules tab.
  2. Enter the cookies mentioned above inside the box Never cache Cookies.
  3. Save the settings.

LiteSpeed Cache

↑ Back to top
  1. Go to WordPress admin > LiteSpeed Cache > Cache > Excludes tab.
  2. In the ‘Do Not Cache URIs’ field, add the slugs to exclude URLs.
  3. In the ‘Do Not Cache Cookies’ field, add cookie names.
  4. Save the settings.
  5. Purge all caches.

W3 Total Cache

↑ Back to top
  1. Go to WordPress admin > Performance > Page Cache > Advanced tab.
  2. In the ‘Never cache the following pages’ field, add the slugs to exclude URLs.
  3. In the ‘Rejected cookies’ field, add cookie names.
  4. Save the settings.
  5. Purge all caches.

WP Fastest Cache

↑ Back to top
  1. Go to WordPress admin > WP Fastest Cache > Exclude tab.
  2. Add a new rule to exclude URLs.
  3. Add a new rule to exclude cookies and enter cookie names.
  4. Save the settings.
  5. Clear all caches.

NitroPack

↑ Back to top
  1. You can exclude URLs by following this doc.
  2. You can exclude from optimization by Cookie by following this doc.

For more information, please refer to the documentation of your specific caching plugin.

Some additional pointers to consider

↑ Back to top

Caching 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.

Facing any issues?

↑ Back to top

Reach out to us from here and we will help you.

Feature request

↑ Back to top

Have a feature request or enhancement suggestion for Affiliate For WooCommerce? Submit it from here: Submit a feature request.