How does AffiliateWP track visits with cookies?
AffiliateWP uses cookies to track affiliates and visits so referrals can be generated. This article explains why the cookies are important, and how you can see them in your browser when testing the system to check a visit has been created.
How they work
A cookie is a small piece of data which is stored in a user’s web browser when they visit a website. When a customer comes to your website via an affiliate referral link (i.e. yoursite.com/?ref=123), AffiliateWP stores two main browser cookies in order to track the referring affiliate, and the visit. Their names are:
- affwp_ref - this cookie stores the affiliate's unique ID
- affwp_ref_visit_id - this cookie stores the visit ID (the visit ID increments by 1, each time any referral link is used until the cookie expires or is deleted).
As of version 1.7.7 AffiliateWP also stores a third cookie for affiliate campaign tracking. The name of the cookie is affwp_campaign. This cookie will only be stored if an affiliate generates an affiliate referral URL with a campaign name from the Affiliate Area, and that link is clicked on by a customer.
Firefox
- Visit your product page or website via the affiliate referral link
- Go to the Tools menu in the top menu bar, scroll down to “Web Developer” -> and click on “Developer Toolbar”. This will display a toolbar at the bottom of your browser window
- In the toolbar, type “cookie list” and press Enter/Return on your keyboard - this will display a list of the cookies on your website
- Look for the affiliate ID cookie (i.e. affwp_ref=123) and the visit ID cookie (i.e. affwp_ref_visit_id=1). If the affiliate has created a campaign, the affwp_campaign cookie will also be visible.
Chrome
- Visit the product page or website page via the affiliate referral link
- Go to the View menu in the top menu bar
- Go to the Developer option
- Click on “Developer Tools"
- In the “Application" tab, click on the “Cookies” drop-down menu in the "Storage" section on the left and click on the name of your website - the affwp_ref and affwp_ref_visit_id cookies should be visible there. If the affiliate has created a campaign, the affwp_campaign cookie will also be visible.
Safari
- Visit the product page or website page via the affiliate referral link
- Go to the Develop option in the top menu bar
- Click on “Show Web Inspector"
- In the “Storage” tab click on Cookies in the left navigation menu - the affwp_ref and affwp_ref_visit_id cookies should be visible there. If the affiliate has created a campaign, the affwp_campaign cookie will also be visible.