If you wish to track referrals for successful conversions of custom success pages, the
[affiliate_conversion_script] shortcode allows you to track affiliate referral links and generate referrals on successful conversions by placing it on your "success" page.
When a visitor comes to your site via an affiliate link and successfully makes it through your checkout, signup form, or any other conversion process, this shortcode will generate a referral record for the affiliate whose link was clicked.
[affiliate_conversion_script] should be placed on your "success" page (the page visitors land on after completing their purchase or signup). The shortcode accepts several parameters that allow you to define the various values for the referral generated:
- amount - The purchase amount that the referral should be based on. This is the total purchase amount, not the total referral amount. The referral amount will be calculated based off of the referral rate for the affiliate.
- description - A description logged with the referral.
- context - A context for the referral. You will want to use this if you have multiple purchase or signup forms.
- reference - A unique reference variable for the affiliate. This could be the user ID of the new user (if they are signing up for your site) or a transaction ID.
- status - The status to give the referral. By default, referrals created with this shortcode will be set to "pending". Valid options are: "pending", "unpaid", "paid", and "rejected".
- type - The type of referral. By default, a referral will have a type of "sale". Valid options are "sale", "lead" and "opt-in".
An example using all of the parameters above:
[affiliate_conversion_script amount="10" description="My Description" context="Contact Form" reference="1234" status="pending" type="lead"]
Important information for using this shortcode — please read:
- Usage: The [affiliate_conversion_script] shortcode can be used on multiple success pages, but a referral cannot be generated again until cookies are cleared/expired.
- Formatting: Ensure you leave spaces between the script parameters as seen in the above example, otherwise you will have blank entries, including a zero amount when the referral is created.
- Coupons: The [affiliate_conversion_script] shortcode does not support coupon usage of any type; for example, if your customers are using discount/coupon codes to purchase products, this will not have any effect on the referral amount awarded to the affiliate, when using this shortcode. The referral amount will only be calculated based on the amount entered inside the [affiliate_conversion_script] shortcode (see the amount parameter above for more information). If you would like discounts and coupons to affect affiliate referral amounts, please consider using one of our supported integrations.
Advanced usage - Passing query string parameters to the conversion script shortcode
You can pass amount as a query string parameter in the URL which will allow for dynamic referral amounts. For example, if you were able to link to a purchase confirmation page when a purchase is made, you could pass the extra parameter in the URL like this:
In the above example, /thanks is the purchase confirmation page where the shortcode has been added.
The 100 would change based on the amount as it is the purchase amount the referral should be based on. If the purchase amount is $200, use 200. If it's $400, use 400 etc.
When the customer lands on the purchase confirmation page, the [affiliate_conversion_script] shortcode will see the amount passed in from the URL and use that value to calculate the referral.
Here is in example using all the parameters as a query string in the URL:
https://mysite.com/thanks/?amount=100&description=My Description&context=Contact Form&reference=1234&status=pending&type=lead
You can change the other parameters based on the descriptions above.
Note: Any dynamic value passed in cannot already be represented in the shortcode. For example, if you have an amount parameter already in the shortcode, it will not be overwritten when you pass in a new value on the query string.