Notice: There is no legacy documentation available for this item, so you are seeing the current documentation.
Want to streamline coupon creation for your affiliate program? Dynamic coupons in AffiliateWP allow you to automatically generate personalized coupons for affiliates, simplifying the process of assigning and managing affiliate coupons. Instead of manually creating a coupon for each affiliate, dynamic coupons can be automatically generated during registration or in bulk by the site admin.
In This Article
- How Dynamic Coupons Work
- Enabling dynamic coupons
- Automatically generating dynamic coupons for affiliates
- Dynamic Coupon Customization
- Bulk generating dynamic coupons
- Generating a dynamic coupon for a specific affiliate
- Deleting a dynamic coupon for a specific affiliate
- Showing a dynamic coupon to the affiliate
- Frequently Asked Questions
How Dynamic Coupons Work
Dynamic coupons inherit their settings from a coupon template that you designate in WooCommerce. This ensures all dynamic coupons share the same configuration, such as discount amount, excluded products, or free shipping eligibility. If you need to update coupon settings later, you can simply adjust the template, and all dynamic coupons will automatically reflect the changes.
The following fields are inherited by dynamic coupons from the coupon template:
- amount
- discount_type
- excluded_product_ids
- excluded_product_categories
- product_ids
- individual_use
- free_shipping
- exclude_sale_items
- date_expires
At this time, the settings under these sections are not inherited by dynamic coupon via the coupon template selected:
Usage Limits – (all settings)
Usage Restriction – these specific settings:
- minimum spend
- maximum spend
- product categories
- Allowed emails
Enabling dynamic coupons
Create a new coupon (if needed) by going to Marketing » Coupons once you’ve installed and activated WooCommerce. Once your coupon is ready:
- Go to AffiliateWP » Settings » Coupons in your WordPress dashboard.
- Select the WooCommerce coupon you created as the Coupon Template.
The coupon template cannot be assigned to an affiliate, otherwise, it will not show in the coupon template dropdown on the AffiliateWP settings page.
Automatically generating dynamic coupons for affiliates
When affiliates join your program, dynamic coupons can be automatically generated for them.
To do this, enable the Automatically Generate Coupons option. You can find this option also on the AffiliateWP » Settings » Coupons screen:
Once enabled, a dynamic coupon will be automatically generated when:
- An affiliate registers from the front-end using the default affiliate registration form.
- Affiliate approval is enabled, and an affiliate is approved from either the Accept quick action link, the Bulk Actions menu, or from the Review Affiliate screen.
- An affiliate is added manually from within the WordPress admin, and the Affiliate Coupon checkbox is enabled.
- Affiliate accounts are created when the setting Automatically register new user accounts as affiliates is enabled in AffiliateWP » Settings » Affiliates.
Currently dynamic coupons are automatically generated during new affiliate registration when using one of the default affiliate registration forms (block or shortcode based). If using a custom affiliate registration form via Elementor Forms, Gravity Forms, Ninja Forms, or WPForms, dynamic coupons will not be automatically generated when new affiliates register.
Dynamic Coupon Customization
You can also customize how the coupon names will be formatted when generated with a coupon format, custom text, and a hyphen delimiter.
The coupon format merge tag names can be put together in any order desired:
- {user_name}
- {coupon_code}
- {coupon_amount}
- {custom_text}
For example, for an affiliate with the username of Alfred and a coupon discount amount of 10%, this would be {user_name}{coupon_amount}, resulting in Alfred10 as the actual coupon code generated.
There is also the option to insert a hyphen in between each coupon merge tag.
At this time the maximum length of characters for a username that will display is 10.
Bulk generating dynamic coupons
Dynamic coupons can be bulk generated for all affiliates that do not currently have a dynamic coupon.
Go to AffiliateWP » Tools » Coupons, and click the Generate Coupons button. A dynamic coupon will be generated for all active affiliates that do not already have a dynamic coupon assigned.
It is also possible to bulk generate dynamic coupons for all affiliates and override all existing dynamic coupons. If an affiliate already has a dynamic coupon, an entirely new coupon will be generated for them.
To override all dynamic coupons, enable the setting Override existing coupon for all affiliates. Then, click the Generate Coupons button.
Generating a dynamic coupon for a specific affiliate
A dynamic coupon can be generated for a specific affiliate.
Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.
Next to Dynamic Coupon Code, click the Generate Coupon button if one does not exist, or, click Delete Coupon first if they already have a coupon code generated, but want a new one.
Deleting a dynamic coupon for a specific affiliate
A dynamic coupon can be deleted for a specific affiliate.
Click the affiliate’s name from the AffiliateWP » Affiliates screen to go to their Edit Affiliate screen.
Next to Dynamic Coupon Code, click the Delete Coupon button (see image above).
The coupon code will then be deleted.
Showing a dynamic coupon to the affiliate
Dynamic coupons can be shown to an affiliate from either:
- The Affiliate Area
- The affiliate accepted email
Affiliate Area
A new Coupons tab will show within the Affiliate account and the Affiliate Portal screens if:
- An affiliate has a dynamic coupon code assigned to them.
- An affiliate has one or more manually assigned coupon codes assigned to them.
Application accepted email
You can use the {registration_coupon}
email tag to include the dynamic coupon code in the acceptance email. You can configure this by editing the Application Accepted Email Content under AffiliateWP » Settings » Emails.
Frequently Asked Questions
What happens if an affiliate already has a manually assigned coupon?
Dynamic coupons cannot replace manually assigned coupons. You must delete the manually assigned coupon before generating a dynamic coupon for the affiliate.
Can I create a custom registration form that supports automatic dynamic coupon generation?
Currently, automatic coupon generation is only supported with default AffiliateWP registration forms. Custom forms built with plugins like Gravity Forms or Ninja Forms do not trigger automatic coupon creation.
What settings are not inherited from the WooCommerce coupon template?
Settings under Usage Limits (e.g., usage per coupon, usage per user) and specific restrictions like minimum/maximum spend or allowed emails are not inherited by dynamic coupons.
How can I test the dynamic coupon feature?
Create a test affiliate account and enable dynamic coupons for it. You can then verify that the coupon is generated, inherits the correct template settings, and appears in the Affiliate Area.
Is there a limit to the length of dynamic coupon codes?
Yes, the {user_name}
merge tag is limited to 10 characters to ensure the generated coupon codes remain concise and functional.
That’s it! Dynamic coupons are a powerful feature in AffiliateWP, simplifying the process of managing affiliate coupons. By using dynamic coupon templates, you can ensure consistency across all coupons while easily updating settings as needed. With options for automatic or manual generation, as well as flexible customization, dynamic coupons save time and streamline your affiliate management process.
By following this guide, you’ll be ready to implement dynamic coupons effectively, helping your affiliates promote your business while maintaining control over coupon settings.