Enabling referral discount codes
To let your affiliates track sales using a discount code, navigate to "Groups" and click on the group you want to enable a referral code for. First, select the "Discount type" you want to use for the group. The options available are:
"Amount off order" will apply the discount rule to the entire order.
"Amount off collections" will let you select which collections the discount rule will apply to.
"Amount of products" will let you select which products the discount rule will apply to.
"Free Shipping"
Next, hit "Edit referral rule" - this will take you to Shopify's built-in discount code page.
NOTE: Due to Shopify limitations, it's not possible to save a discount code rule with $0 or 0% off
Setting the rule
It is important to note that (1) the discount rule you set will apply to the entire group (2) affiliate commission is calculated after all discounts are applied. Since this is the built-in Shopify discount feature, you have full flexibility over your rule. You can configure "Minimum purchase requirements", "Customer eligibility", "Minimum discount uses", and "Combinations". Once you are done, hit save.
Confirming your settings
If you want to change your discount rule, you can do so any time - any change will automatically update any affiliate's discount codes who are members of that group
You will also see that the group now shows "Active". There is a discount code rule active, and members can use discount codes assigned to them to track referrals.