Ever wondered how AffiliateWP ensures that affiliates are credited for their referrals? It uses cookies to track visits and referrals, ensuring the right affiliate is rewarded for every conversion.
In this guide, we’ll explain how AffiliateWP cookies work, how to test their functionality in popular browsers, and why they’re essential for your affiliate program.
How AffiliateWP Cookies Work
Cookies are small data files stored in a customer’s browser when they visit a website. AffiliateWP uses cookies to track the referring affiliate, record visits, and generate referrals. When a customer clicks on an affiliate’s referral link (e.g., yoursite.com/?ref=123
), AffiliateWP stores three main cookies in the browser:
affwp_ref
: Stores the affiliate’s unique ID, such as123
.affwp_ref_visit_id
: Stores the visit ID, which increments with every new visit tracked.affwp_campaign
: Tracks campaign data if an affiliate uses campaign names in their referral URLs. This cookie is only created when a campaign-specific URL is used.
If your site is hosted on Pantheon, the cookies will be named wp_affwp_ref, wp_affwp_ref_visit_id, and wp_affwp_campaign
When a customer completes their purchase or conversion process, these cookies ensure the correct affiliate is credited for the referral. The cookies remain active for the duration specified in AffiliateWP » Settings » Commissions » Cookie Expiration or until the customer manually clears their cookies.
If cookies are not visible in the browser after a customer clicks on a referral link, visits will not be tracked, and referrals will not be generated. This makes it essential to test and confirm that cookies are being stored correctly.
Viewing Cookies in Popular Browsers
To verify that AffiliateWP cookies are functioning, you can inspect them using the developer tools in your browser. Here’s how to check them in Firefox, Chrome, and Safari:
Firefox
- Visit your site using an affiliate referral link.
- Open the Tools menu, navigate to Browser Tools, and select Web Developer Tools.
- Click on the Storage tab in the horizontal menu and select Cookies in the left-hand menu. Choose your website name to view the stored cookies.
- Look for
affwp_ref
,affwp_ref_visit_id
, and, if applicable,affwp_campaign
. These cookies will contain the affiliate ID, visit ID, and campaign name, respectively.
Chrome
- Visit your site using an affiliate referral link.
- Open the View menu, go to Developer, and select Developer Tools.
- Click on the Application tab, expand the Cookies section under Storage, and select your website.
- Check for the
affwp_ref
,affwp_ref_visit_id
, andaffwp_campaign
cookies.
Safari
- Visit your site using an affiliate referral link.
- Go to the Develop menu and select Show Web Inspector.
- Click on the Storage tab and select Cookies from the left-hand menu. Choose your website to view the cookies.
- Confirm the presence of the
affwp_ref
,affwp_ref_visit_id
, andaffwp_campaign
cookies.
Each cookie contains a value indicating the affiliate ID, visit ID, or campaign name. These values allow you to identify the affiliate being tracked and confirm that visits are being recorded.
AffiliateWP counts unique visits, meaning that no new visit entries are created if the cookies are still active in the browser. However, the affiliate will continue to be tracked across all pages as long as the cookies remain present. Keep in mind that AffiliateWP tracks visits, not individual clicks or page views.
Testing and Clearing Cookies
When testing AffiliateWP to confirm proper tracking, it may be necessary to clear your browser cookies. Clearing cookies removes previous tracking data, allowing you to start fresh. For detailed instructions, check out the AffiliateWP article: How to Delete AffiliateWP Cookies from Your Browser.
Frequently Asked Questions
What happens if cookies aren’t generated in the browser?
If cookies aren’t created after clicking a referral link, no visits will be tracked, and no referrals will be generated. Ensure cookies are enabled in the browser and verify your AffiliateWP setup.
How long do AffiliateWP cookies last?
The duration of AffiliateWP cookies is determined by the Cookie Expiration setting in AffiliateWP » Settings » Commissions. Cookies remain active until this duration expires or the customer clears their cookies.
Does AffiliateWP track individual page views or clicks?
No, AffiliateWP tracks unique visits, not individual clicks or page views. As long as the cookies are active, the affiliate will be tracked across all pages.
What is the purpose of the affwp_campaign
cookie?
The affwp_campaign
cookie tracks campaign data. It is generated when an affiliate includes a campaign name in their referral URL, helping them monitor specific promotional efforts.
That’s it! AffiliateWP uses cookies to reliably track affiliate referrals and visits, ensuring the right affiliates are credited for conversions. By testing cookies in popular browsers, checking for proper storage, and clearing cookies during testing, you can confirm your system is working as intended.