Will AffiliateWP work on a subdomain?

AffiliateWP can only track referrals and visits on the site that it is installed on. This will need to be the site where you have your eCommerce store. When a purchase is made by a customer, and that customer was referred by an affiliate, the affiliate will then receive a commission on the purchase.

You can certainly install AffiliateWP on a subdomain such as affiliates.yoursite.com, however if you also install AffiliateWP on yoursite.com you’ll have two separate and unique affiliate systems which are not synced with each other in any way. We recommend installing AffiliateWP on your yoursite.com domain, where your eCommerce system is installed. This will allow AffiliateWP to track sales and create referrals.

If you absolutely must have AffiliateWP also installed on affiliates.yoursite.com, you’ll need to activate AffiliateWP network-wide. Currently this is the only way to achieve this. As per the documentation article linked above regarding running AffiliateWP within a multisite installation, this is the only way to share the database tables between sub-sites and have the affiliates shared between your affiliates.yoursite.com and yoursite.com domains. Please also see the additional notes about referral tracking at the bottom of the doc. You may opt for sub-folders instead of sub-sites.