Visits or referrals are not working

Are you experiencing issues with affiliates not being tracked, where visits or referrals are not being created? If so, this document can guide you on each step with what to look for, and how to make corrections and adjustments where needed.

Below we will help you perform some top line troubleshooting checks to determine why an affiliate is not being tracked, a visit is not being stored, or a referral is not being generated.

  1. Troubleshooting Visits
  2. Troubleshooting Referrals
  3. External Issues

1. Troubleshooting Visits

The most common reason a referral is not generated is because a visit has not successfully been stored. You can view successfully stored visits on the  AffiliateWP » Visits page in your WordPress admin. Visits are only recorded when the AffiliateWP first-party tracking cookies have been added to your web browser’s cookies. Work through the below checklist to ensure cookies and visits are being stored correctly.

  • Please ensure you are using the latest version of the AffiliateWP plugin.
  • Ensure your affiliate’s account status shows as Active on the AffiliateWP » Affiliates page .
  • Ensure you or your affiliates are using a correct affiliate referral URL, along with the correct referral variable, and an active affiliate ID (or username). Check out the acceptable URL formats in this doc: Affiliate URLs
  • Ensure you have checked your browser cookies to see if the AffiliateWP cookies are present, and are still active, otherwise a visit entry won’t be recorded. This doc shows you how to check your browser for the AffiliateWP cookies, and how to delete old ones if needed to re-test: How to view and delete cookies from your browser
  • If you still are not seeing cookies and visits recorded, this may be due to caching or script optimization either locally with a plugin, Cloudflare (or simliar CDN services), or from your web hosts server-side settings. This doc can walk you through how to the check some of the most popular caching/optimization plugins and settings: How AffiliateWP works with caching
  • Are you aware of any JavaScript errors on your site? You can see if you have JavaScript errors through the console of your internet browser. If there are any errors in the web browser console when you are testing (keep it open so you can check), these will be outlined with a pink or red line and be very visible and will affect the tracking script. Look out specifically for JavaScript errors – they will show a file path name that ends with .js. These errors are the most likely culprits of plugin and theme conflicts, which can have an impact on cookies and visits not being stored, and therefore referrals not being generated.
  • Check out this article on the WordPress.org codex which explains how to view potential JavaScript errors in your preferred browser: Using Your Browser to Diagnose JavaScript Errors

Troubleshooting JavaScript errors

  • Temporarily deactivate all other plugins except for AffiliateWP, and test visits, and then referrals (with your chosen integration) to see if the JavaScript error disappears.
  • Slowly start reactivating other plugins. Do this one by one, or in small groups (of 2 or 3) and test the process each time. This will help you narrow down which plugin may be causing the conflict.
  • When you have determined which plugin is causing the conflict, we recommend contacting the plugin developer to see if they can help you resolve the issue.

Enabling the Fallback tracking method

If you’re not able to remedy the JavaScript errors, AffiliateWP has a fallback tracking option which can be enabled to allow referrals to be generated. This fallback tracking method can also assist in cases where ad blockers may be blocking the tracking script from loading.

To do this, enable this option in the  AffiliateWP » Settings » Advanced tab, by checking the box next to Use Fallback Referral Tracking Method. Then, click the Save Changes button to save your settings.

However, whenever possible we do recommend fixing JavaScript errors, as they may also impact the performance of other WordPress plugins.

Alternatively, if you do have Fallback Referral Tracking enabled, and visits are not working, try disabling this setting, saving the changes, and testing again.

2. Troubleshooting Referrals

In the instance that visits are being stored correctly, but referrals are not being generated, use the below checklist to troubleshoot potential causes for this issue. You can view generated referral entries on the AffiliateWP » Referrals page in your WordPress admin.

  • Ensure your chosen integration is installed and activated. If possible, please make sure you are using the latest version of your integration.
  • Ensure you have enabled your chosen integration/s in the AffiliateWP » Settings » Integrations tab.
  • Ensure you are not logged in as the affiliate, or using the affiliate account’s email address when testing a purchase, as by default AffiliateWP blocks affiliates from creating their own referrals (you can allow affiliates to generate their own referrals with the Allow Own Referrals addon).
  • Is the Ignore Referrals With Zero Amounts option selected in the AffiliateWP » Settings » Commissions tab? And are you trying to generate $0.00 amount referrals (e.g. for lead generation or a free trial period on a subscription)? If so, referrals will not be recorded.
  • Is the Allowed Products addon installed and activated, and no products have been specified in the Allowed Products field on the AffiliateWP » Settings » Integrations tab? If you are using the Allowed Products addon with your chosen integration, but have not specified any products, $0.00 amount referrals will be generated. If combined with the Ignore Referrals With Zero Amounts option, no referrals will be generated.

Enable Debug Mode

AffiliateWP includes a handy debug tool to help diagnose common errors in the referral generation process. To enable this, go to  AffiliateWP » Settings » Advanced, and enable the Enable Debug Mode tool. Then, in the AffiliateWP » Tools screen you’ll see a Debug Assistant tab. Try testing the system again, and if there is an error with the system it will show in this log.

For more advanced users, defining AFFILIATE_WP_DEBUG as true in your wp-config.php file will also globally enable debug mode.

If you need some help testing the system, take a look at our doc on  how to test everything is working.

3. External Issues

If everything else appears to be working, there may be a plugin or piece of code in your theme that is conflicting with AffiliateWP. This will require some additional testing. If you have a staging or development website, we recommend ensuring it is up-to-date with a mirror copy of your live site, and perform the below additional tests in that environment. If you do not have a staging or development website you can of course perform these tests on your live site, however, make sure you have a recent backup if needed.

  • Temporarily deactivate all other plugins except for AffiliateWP, and test that visits are being stored correctly
  • Then, while all other plugins are deactivated except for AffiliateWP, reactivate your integration, and test that referrals are being generated correctly. If referrals work correctly at this point, it is likely there is a conflict with another plugin you have installed or activated.
  • Slowly start reactivating other plugins. Do this one by one, or in small groups (of 2 or 3) and test the process each time. This will help you narrow down which (if any) plugin may be causing the issue.
  • When you have determined which plugin is causing the conflict, we recommend contacting the plugin developer to see if they can help you resolve the issue.
  • If referrals still aren’t working, temporarily change your website’s theme to a default WordPress theme (Twenty Twenty-Two, Twenty Twenty-One, Twenty Twenty, etc) and test the system again. If referrals start working after temporarily switching themes, it’s likely some code within your chosen theme is causing a conflict with AffiliateWP. In this instance we recommend contacting the theme developer to see if they can help you resolve the issue.

That’s it! Now you know how to troubleshoot affiliate tracking, visit or referral issues in AffiliateWP.