Documentation

Summary

  1. Installation [+]
    1. Activation Key
  2. Upgrade [+]
    1. Automatic Upgrade
  3. Affiliate Links [+]
    1. Alternative Affiliate Links
    2. Clicks Registration
    3. Redirection
  4. Affiliate Cookies [+]
    1. Award Of Commission
  5. Commissions Levels
  6. Commissions Payment [+]
    1. Deferred Payment
    2. Instant Payment
    3. Award Of The First Sale
    4. Optional Registration
    5. Refund
  7. Contents Restricted To Affiliates [+]
    1. Content Specific To An Affiliate Category
  8. Pages Restricted To Affiliates [+]
    1. Page Specific To An Affiliate Category
    2. Logout Page
    3. Non-WordPress Static Websites
  9. Comments Restricted To Affiliates [+]
    1. Comments Specific To An Affiliate Category
  10. Affiliate Status [+]
    1. Activation Link
    2. Automatic Login
  11. Display Of Informations About The Affiliate [+]
    1. The default Attribute
    2. The filter Attribute
    3. The decimals Attribute
    4. The part Attribute
  12. Display Of Informations About An Affiliate Category [+]
    1. The default Attribute
    2. The filter Attribute
    3. The decimals Attribute
    4. The part Attribute
    5. Display Of Informations About The Affiliate Category
  13. Display Of Informations About A Click [+]
    1. The default Attribute
    2. The filter Attribute
  14. Bonus Offered By The Affiliate [+]
    1. Display Of The Bonus Proposal Form
  15. Counters [+]
    1. Display Of Numbers And The Limit
    2. Automatic Content Substitution
    3. Succession Of Counters
    4. The range Attribute
  16. Counters Of Affiliate's Performances [+]
    1. Display Of Numbers And The Limit
    2. Automatic Content Substitution
    3. Succession Of Counters
    4. The range Attribute
    5. Default Referrer
  17. Display Of The Options [+]
    1. The default Attribute
    2. The filter Attribute
    3. The decimals Attribute
  18. Encryption Of URLs
  19. Emails
  20. Autoresponders [+]
    1. AWeber
    2. CyberMailing
    3. GetResponse
    4. MailChimp
    5. MailerLite
    6. Sendinblue
    7. Sendy
    8. SG Autorépondeur
  21. Registration As A Client
  22. Membership
  23. WordPress
  24. Display Of Informations About The User [+]
    1. The default Attribute
    2. The filter Attribute
  25. Custom Instructions
  26. Display Of Forms [+]
    1. Redirection
    2. Automatic Positioning Of The Cursor
    3. Automatic Completion Of Fields
    4. Attributes
  27. Creation Of Forms [+]
    1. The [input] Cotillion
    2. Attributes Of The [input] Cotillion
    3. The [textarea] Cotillion
    4. Attributes Of The [textarea] Cotillion
    5. The [select] Cotillion
    6. Attributes Of The [select] Cotillion
    7. The [option] Cotillion
    8. Attributes Of The [option] Cotillion
    9. Required Fields
    10. Error Messages
    11. Attributes Of The [error] Cotillion
    12. The [label] Cotillion
    13. Attributes Of The [label] Cotillion
    14. CAPTCHAs
    15. Attributes Of The [captcha] Cotillion
    16. Double Entry
    17. Current Password
    18. The Submit Button
    19. The [validation-content] Cotillion
    20. The [indicator] Cotillion
    21. Attributes Of The [indicator] Cotillion
  28. Display Of Statistics
  29. Personalization Of Statistics [+]
    1. The [if] Cotillion
    2. The [foreach] Cotillion
    3. The status Attribute
  30. Instant Notifications
  31. Periodic Reports
  32. Creation Of Your Pages Relating To Affiliation [+]
    1. Your Registration Page
    2. Your Registration Confirmation Page
    3. Your Password Reset Page
    4. Your Login Page
    5. Your Logout Page
    6. Your Affiliates Home Page
    7. Your Profile Edit Page
    8. Your Statistics Page
    9. Your Menu
  33. GDPR [+]
    1. Attributes Of The [affiliate-data-download-link] Cotillion
  34. Custom Fields
  35. Non-WordPress Static Websites [+]
    1. Installation Of WordPress
    2. The Files Of Your Website
    3. Loading Of WordPress
    4. Use Of Cotillions
  36. Advanced Customization [+]
    1. Navigation Menu
    2. Generation And Evaluation Of Passwords
    3. Custom Autoresponders
    4. Custom Files
    5. Custom Languages
  37. FAQ [+]
    1. Can I use cotillions in fields of admin pages?
    2. How can I schedule an automatic modification of the commission percentage according to the date?
    3. How can I schedule an automatic modification of the commission percentage according to the affiliate's performances?
    4. How can I use cotillions in my WordPress theme?
    5. How can I use cotillions in comments?
    6. How can I use cotillions in attributes of cotillions?
    7. How can I nest several identical cotillions?
  38. Changelog

Quick Start

Here's how to set up your affiliate program in less than 3 minutes:

1. Configure the options of the General options module of the Options page of Affiliation Manager.

That's all!

You can test the pages of the affiliate area by creating your affiliate account through the Add Affiliate page of Affiliation Manager, or through the registration page of your affiliate area. You can also customize the menu displayed at the top of the pages of the affiliate area through the Menu module of the Front Office page of Affiliation Manager, and add some pages of the affiliate area to the navigation menu of your website through the Menus page of the Appearance menu in WordPress.

The Back Office page of Affiliation Manager allows you to customize your interface. With this page, you will can display the items that are useful for you and remove the others. In short, you will get an interface that fits precisely to your needs. We advise you to quickly browse through the admin pages of Affiliation Manager in order to have a global vision, and then take the time to properly configure your options.

If you have installed one or more cache plugins on your website, we recommend you to deactivate them for the pages of the affiliate area. The principle of these plugins is to speed up your website by preventing it from working properly, more precisely by preventing the scripts of your website from generating pages on the fly and by using a cached version instead. Cache plugins are therefore likely to cause some problems.

Among the problems that can occur, the visitors of your website could access pages restricted to your members/clients/affiliates without logging in, and see the personal informations of another member/client/affiliate instead of their own. If you use Commerce Manager, your purchase buttons/links/forms may not work properly.

You can also deactivate all your cache plugins (after emptying their caches). And in your wp-config.php file, remove this line if it exists:

define('WP_CACHE', true);

1. Installation

You can install Affiliation Manager through the Add Plugins page of the Plugins menu in WordPress (Plugins => Add New => Upload Plugin). Upload the plugin file without unzipping it. You can also install it like this:

  1. Unzip the plugin file.
  2. Upload with your FTP software the affiliation-manager folder, and only this folder, to your plugins directory (it should be wp-content/plugins).

Once you have installed Affiliation Manager:

  1. Activate the plugin through the Plugins menu in WordPress.
  2. Click on the Affiliation menu in WordPress and answer the questions to automatically configure the plugin according to your answers.

1.1 Activation Key

You must enter your activation key in the Activation key field of the Activation/Upgrade module in the Options page of Affiliation Manager. This key is mandatory to avoid an automatic deactivation of Affiliation Manager in a few hours. You can find it in the home page of your client area, and in the emails you received just after your order.

2. Upgrade

When you upgrade Affiliation Manager, you don't lose any settings or any data.

You can upgrade Affiliation Manager through the Plugins menu in WordPress, and through the WordPress Updates page of the Dashboard menu in WordPress (Dashboard => Updates), or through the Add Plugins page of the Plugins menu in WordPress (Plugins => Add New => Upload Plugin, upload the plugin file without unzipping it). You can also upgrade it like this:

  1. Unzip the plugin file.
  2. Upload with your FTP software the affiliation-manager folder, and only this folder, to your plugins directory (it should be wp-content/plugins), without deleting the affiliation-manager folder that already exists in this directory.

You don't need to deactivate and reactivate the plugin.

2.1 Automatic Upgrade

You can choose to automatically install all the upgrades of Affiliation Manager as soon as they become available, by checking the Automatically upgrade Affiliation Manager box of the Activation/Upgrade module in the Options page of Affiliation Manager. To make sure it works well, enter your FTP credentials in your wp-config.php file, like this:

define('FTP_HOST', 'your-ftp-host');
define('FTP_USER', 'your-ftp-username');
define('FTP_PASS', 'your-ftp-password');

If it still doesn't work, make sure the PECL Zip extension is enabled on the server that hosts your website.

3. Affiliate Links

To earn commissions on the sales of your products, your affiliates must use affiliate links. When a user clicks on the link of an affiliate, a cookie is installed on his computer. And if he orders one of your products, a commission is awarded to the affiliate due to this cookie.

To get an affiliate link, simply add:

Replace variable with the name you specified for the variable used in affiliate links through the Options page of Affiliation Manager, and login with the login name of the affiliate. You can also replace login with the ID, the email address or the PayPal email address of the affiliate.

For example, if the name you specified for the variable is a and if the login name of your affiliate is john, then the affiliate link of your affiliate that points to your home page is:

https://www.your-domain-name.com/?a=john

And more generally, to get an affiliate link of your affiliate, simply add:

3.1 Alternative Affiliate Links

Your affiliate program can be compatible with another structure of affiliate links. This can be useful if you used another affiliate software before Affiliation Manager. To get an alternative affiliate link, simply add:

Replace alternative-variable with the name you specified for the alternative variable used in affiliate links through the Options page of Affiliation Manager, and login with the login name of the affiliate.

For example, if the name you specified for the alternative variable is e and if the login name of your affiliate is john, then the alternative affiliate link of your affiliate that points to your home page is:

https://www.your-domain-name.com/?e=john

And more generally, to get an alternative affiliate link of your affiliate, simply add:

3.2 Clicks Registration

You can choose, through the Options page of Affiliation Manager, to save the clicks on affiliate links into your database. This allows you to monitor the activity of your affiliates and detect cookie stuffing. The clicks registration also allows the identification of the visitor by his IP address, as shown here.

You can choose to not save the clicks made by bots (search engines in particular). In this case, Affiliation Manager will attempt to detect them. However, it's not absolutely reliable. So there may be a few clicks made by bots saved into your database.

3.3 Redirection

You can choose, through the Options page of Affiliation Manager, to redirect or not the user to the URL without affiliate parameter just after a click on an affiliate link. Choose to redirect him can help you to improve your SEO.

4. Affiliate Cookies

When a user clicks on an affiliate link, a cookie and a localStorage item are installed on his computer, allowing the affiliate to earn commissions on the sales of your products. You can specify the name and the lifetime of this cookie through the Options page of Affiliation Manager.

If the cookie has been deleted, Affiliation Manager will attempt to recognize the user with the localStorage item, and then by his IP address (if you have enabled the clicks registration) or his email address in case of failure. Thus, the affiliate can still get commissions on the sales of your products.

4.1 Award Of Commission

You can decide if the commission is awarded to the first or the last affiliate who referred the user.

If the commission is awarded to the last affiliate who referred the user, then when a user clicks on several affiliate links, each click always creates an affiliate cookie that replaces the existing cookie, allowing to award the commission to the last affiliate.

If the commission is awarded to the first affiliate who referred the user, then when a user clicks on several affiliate links, the first click creates an affiliate cookie that will never be replaced by another cookie, allowing to award the commission to the first affiliate. And if the user has a client account, an affiliate account or a member account, the commission will be awarded to the referrer of this account.

5. Commissions Levels

Affiliation Manager supports 2 levels of commissions:

You can choose to use only one level of commission. Award a level 2 commission allows you to encourage your affiliates to recruit other affiliates.

6. Commissions Payment

6.1 Deferred Payment

If you opt for the deferred payment of commissions, then as its name suggests, when a commission is awarded to an affiliate, it is not paid immediately. You pay this commission at the end of a delay that you set freely.

You can, in the Options page of Affiliation Manager or in the edit page of an affiliate or an affiliate category, set a minimum amount that the affiliate must reach to receive the payment of his commissions.

You can pay at once the commissions on sales referred during a specific time range through the Payment page of Affiliation Manager. Enter a start date and an end date. Then download the file automatically created by Affiliation Manager or create a text file (extension .txt) with a text editor like Notepad++ and copy into this file the text that appears in the text area of the Payment page.

Then, log into your PayPal account, click on the Send Money tab and on Make a mass payment. Download your text file and submit.

Once you have paid the commissions, click on the Mark commissions as paid button to update the status of the commissions.

6.2 Instant Payment

If you opt for the instant payment of commissions (compatible only with PayPal), then when a commission is awarded to an affiliate, it is paid immediately. If the commission percentage is equal to x, then the affiliate does not receive x % of the amount of each sale he refers, but the total amount of x % of the sales he refers.

For example, if the commission percentage is equal to 50, then the affiliate receives the total amount of half of the sales he refers.

6.3 Award Of The First Sale

If you opt for the instant payment of commissions (compatible only with PayPal), then you can decide if the first sale referred by the affiliate is awarded to him or to the affiliator.

For example, if the commission percentage is equal to 50 and if the first sale referred by the affiliate is awarded to him, then:

If the commission percentage is equal to 50 and if the first sale referred by the affiliate is awarded to the affiliator, then:

6.4 Optional Registration

If you opt for the instant payment of commissions (compatible only with PayPal), then you can decide if the users must or not register to your affiliate program in order to earn commissions on the sales of your products. When a user is not registered to the affiliate program, he has no login name. To get his affiliate links, he must use the email address of his PayPal account instead of the login name.

For example, if the name you specified for the variable used in affiliate links through the Options page of Affiliation Manager is a and if the PayPal email address of your affiliate is johnsmith@kleor.com, then the affiliate link of your affiliate that points to your home page is:

https://www.your-domain-name.com/?a=johnsmith@kleor.com

And more generally, to get an affiliate link of your affiliate, simply add:

The registration is always required if you opt for the deferred payment of commissions. When a user is not registered to the affiliate program, he can't receive commissions whose the payment is deferred.

6.5 Refund

When an order or payment is refunded, you can choose to automatically cancel or not the commissions received on this order or payment, provided that these commissions are not already paid. Otherwise, you can choose to deduct or not the overpaid commissions from the future commissions of the affiliate.

7. Contents Restricted To Affiliates

To display a content restricted to affiliates, insert into your posts/pages/widgets a cotillion like this:

[affiliation-content]Content displayed if you are logged in as an affiliate[/affiliation-content]

You can also define a content that will be displayed if the user is not logged in as an affiliate, like this:

[affiliation-content]
Content displayed if you are logged in as an affiliate[other]
Content displayed if you are not logged in as an affiliate
[/affiliation-content]

Result (with a little formatting):

Content displayed if you are not logged in as an affiliate

7.1 Content Specific To An Affiliate Category

To display a content restricted to affiliates of a certain category, insert into your posts/pages/widgets a cotillion like this:

[affiliation-content category=N]Content displayed if you belong to this affiliate category[/affiliation-content]

by replacing N with the ID of the category.

It is possible to specify several IDs for the category attribute, by separating the different IDs by /, like this:

[affiliation-content category=id1/id2/…/idN]Content displayed if you belong to one of these affiliates categories[/affiliation-content]

8. Pages Restricted To Affiliates

You can create pages restricted to users logged in as affiliates, and redirect the users to another page if they're not logged in as affiliates. If you use Affiliation Manager on a non-WordPress static website, follow these instructions.

Note: If you are logged in as an administrator or editor, you will not be redirected.

Create a new page in WordPress. In the edit page of this page, create the affiliation custom field (if you don't see the module of custom fields, follow these instructions, or click on Screen Options at the top right of the page and check the Custom fields box in order to display it) and enter as the value a cotillion like this:

[affiliation-redirection condition=condition url=URL]

by replacing URL with the URL to which you want to redirect the user and condition with:

Custom fields
Custom fields

For example, in the edit page of the page containing your login form, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=session url=URL]

When he's logged in as an affiliate, the user will be immediately redirected to the URL.

To understand how to create your pages relating to affiliation, refer to this section.

8.1 Page Specific To An Affiliate Category

The category attribute works like the attribute of the same name for the [affiliation-content] cotillion.

8.2 Logout Page

To logout the affiliate, he must click on a link that points to urlindex.php?action=logout, where url is the URL of the affiliation-manager directory (in your plugins directory). The logged out affiliate is redirected to your home page.

Your logout URL should look like this:

https://www.your-domain-name.com/wp-content/plugins/affiliation-manager/index.php?action=logout

You can create a logout page with a custom redirection URL. Create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection action=logout url=URL]

by replacing URL with the URL to which you want to redirect the user.

Access to this page will have the effect of logout the affiliate and redirect him to the specified URL.

8.3 Non-WordPress Static Websites

If you use Affiliation Manager on a non-WordPress static website, you can't use custom fields. To replace them, you must insert these lines of cotillion into the PHP file of your webpage:

add_shortcode('affiliation-redirection', create_function('$atts', 'include_once affiliation_path("shortcodes.php"); return affiliation_redirection($atts);'));
$affiliation = '[your-cotillion]'; do_shortcode($affiliation);

just after this line:

include_once $file;

by replacing [your-cotillion] with a cotillion allowing to redirect the user.

If your page contains a login form, you must also insert this line of cotillion:

<?php $redirection = do_shortcode($affiliation); if ($redirection!= '') { echo '<script>window.location = \''.$redirection.'\';</script>'; } ?>

just after this line:

<?php wp_footer(); ?>

9. Comments Restricted To Affiliates

You can create posts/pages whose comments are restricted to users logged in as affiliates.

In the edit page of this post/page, create the affiliation custom field (if you don't see the module of custom fields, follow these instructions, or click on Screen Options at the top right of the page and check the Custom fields box in order to display it) and enter as the value a cotillion like this:

[affiliation-comments condition=condition]

by replacing condition with:

9.1 Comments Specific To An Affiliate Category

The category attribute works like the attribute of the same name for the [affiliation-content] cotillion.

10. Affiliate Status

Your affiliates can have 3 statuses: Active, Inactive and Deactivated. An active affiliate can login to view his statistics, earn commissions, receive instant notifications, periodic reports, and clicks on his affiliate links are registered into your database (if you have enabled this option).

At the opposite, an inactive (or deactivated) affiliate can't login, earn commissions, receive instant notifications, periodic reports, and clicks on his affiliate links are not registered into your database.

You can choose the status assigned to your affiliates upon their registration. If they're inactive, you will must activate them manually, or send them an activation link.

You can also deactivate your affiliates at any time.

The activation confirmation/notification emails are sent only when the affiliate status moves from Inactive to Active, and the deactivation notification email is sent only when the affiliate has been deactivated.

10.1 Activation Link

If when they register, your affiliates are inactive, you can send them an activation link so they can activate their account. To send your affiliates an activation URL, use the following cotillion:

[affiliation-activation-url]

In the Body field of your registration confirmation email, you can insert a cotillion like this:

Click on the link below to activate your affiliate account:

[affiliation-activation-url]

10.2 Automatic Login

You can choose to automatically login your affiliates after their registration through the registration form of Affiliation Manager. If your affiliates are active when they register, they will be logged in immediately. Otherwise, they will be logged in immediately after clicking on their activation link.

To send your affiliates a one-click login URL, use the following cotillion:

[affiliation-login-url]

In the Body field of your registration confirmation email, you can insert a cotillion like this:

Click on the link below to login in one click:

[affiliation-login-url]

11. Display Of Informations About The Affiliate

To display an information about the affiliate, insert into your posts/pages/widgets a cotillion like this:

[affiliate information]

by replacing information with:

This list is not complete and has only the most relevant items. You can find all possible values of information in the tables.php file of Affiliation Manager.

Example:

Percentage of the level 1 commission: [affiliate commission-percentage] %

Result:

Percentage of the level 1 commission: 40 %

You can also display an information about the affiliate who referred the user by inserting into your posts/pages/widgets a cotillion like this:

[referrer information]

Example:

Login name of your referrer: [referrer login]

Result:

Login name of your referrer:

11.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[affiliate information default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

11.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[affiliate information filter=function]

Replace function by the name of the function you want to apply.

Sometimes, the information is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Type of commission: [affiliate commission-type filter=i18n]

Result:

Type of commission: proportional

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[affiliate information filter=function1/function2/…/functionN]

The functions will be applied in the specified order.

11.3 The decimals Attribute

When the information is a numeric data, you can choose the number of digits after the decimal point used to display it, using the decimals attribute, like this:

[affiliate information decimals=value]

Replace value with:

11.4 The part Attribute

You can specify several URLs into the Download URL field of the edit pages of your affiliates, by separating the different URLs with commas. If the bonus of one of your affiliates has several download URLs, you can display the n-th download URL by using the part attribute, like this:

[affiliate bonus-download-url part=n]

Example:

First download URL: [affiliate bonus-download-url part=1]
Second download URL: [affiliate bonus-download-url part=2]
Third download URL: [affiliate bonus-download-url part=3]
…

12. Display Of Informations About An Affiliate Category

To display an information about une affiliate category, insert into your posts/pages/widgets a cotillion like this:

[affiliate-category information id=N]

by replacing N with the ID of the affiliate category and information with:

This list is not complete and has only the most relevant items. You can find all possible values of information in the tables.php file of Affiliation Manager.

Example:

Percentage of the level 1 commission for the affiliates of the category <em>[affiliate-category name id=1]</em>: [affiliate-category commission-percentage id=1] %

Result:

Percentage of the level 1 commission for the affiliates of the category Privileged Affiliates: 50 %

12.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[affiliate-category information default="text" id=N]

Don't forget to include the quotes at the beginning and the end of the default value.

12.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[affiliate-category information filter=function id=N]

Replace function by the name of the function you want to apply.

Sometimes, the information is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Type of commission: [affiliate-category commission-type filter=i18n id=1]

Result:

Type of commission: proportional

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[affiliate-category information filter=function1/function2/…/functionN id=N]

The functions will be applied in the specified order.

12.3 The decimals Attribute

When the information is a numeric data, you can choose the number of digits after the decimal point used to display it, using the decimals attribute, like this:

[affiliate-category information decimals=value id=N]

Replace value with:

12.4 The part Attribute

You can specify several URLs into the Download URL field of the edit pages of your affiliates categories, by separating the different URLs with commas. If the bonus of one of your affiliates categories has several download URLs, you can display the n-th download URL by using the part attribute, like this:

[affiliate-category bonus-download-url part=n id=N]

Example:

First download URL: [affiliate-category bonus-download-url part=1 id=N]
Second download URL: [affiliate-category bonus-download-url part=2 id=N]
Third download URL: [affiliate-category bonus-download-url part=3 id=N]
…

12.5 Display Of Informations About The Affiliate Category

You can specify a cotillion for the id attribute, provided to replace [ by ( and ] by ). It allows you to display an information about the category of the affiliate, like this:

[affiliate-category information id="(your-cotillion)"]

Don't forget to include the quotes at the beginning and the end of the cotillion.

Example:

Your category: [affiliate-category name default="None" id="(affiliate category-id)"]

Result:

Your category: None

13. Display Of Informations About A Click

To display an information about a click, insert into your posts/pages/widgets a cotillion like this:

[click information id=N]

by replacing N with the ID of the click and information with:

13.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty, using the default attribute, like this:

[click information default="text" id=N]

Don't forget to include the quotes at the beginning and the end of the default value.

13.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[click information filter=function id=N]

Replace function by the name of the function you want to apply.

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[click information filter=function1/function2/…/functionN id=N]

The functions will be applied in the specified order.

14. Bonus Offered By The Affiliate

You can allow your affiliates to offer a bonus to customers who order through their affiliate link. Tell them about this opportunity and ask them to contact you if they wish to offer a bonus to customers they refer. When an affiliate contacts you, display his edit page and complete the fields of the Bonus offered to customer module:

Bonus offert au customer
Bonus offered to customer

For example, copy this cotillion into the Instructions to the customer field:

Click on the link below to download the bonus offered by 
your referrer, [referrer first-name] [referrer last-name]:

[referrer bonus-download-url]

Don't forget to insert the following cotillion where you want in the body of your order confirmation email:

[referrer bonus-instructions]

Order confirmation email
Order confirmation email

14.1 Display Of The Bonus Proposal Form

To allow your affiliates to offer a bonus easily, insert this cotillion into your posts/pages/widgets:

[affiliation-bonus-proposal-form]

This cotillion displays, if the user is logged in as an affiliate, a form that allows him to send an email containing his bonus proposal. You can customize the sender, the receiver, the subject and the body of this email through the Options page of Affiliation Manager.

You can redirect the affiliate to a page of your choice when he completed the form, by inserting the following cotillion:

[affiliation-bonus-proposal-form redirection=URL]

Replace URL with the URL to which you want to redirect the affiliate.

You can automatically position the cursor in the first field of the form when the page loads. Insert this cotillion into your posts/pages/widgets:

[affiliation-bonus-proposal-form focus=yes]

15. Counters

To display a counter, insert into your posts/pages/widgets a cotillion like this:

[affiliation-counter data=data limit=L]
Data: [number][/affiliation-counter]

by replacing L with a positive number and data with:

When the limit is reached, the content between [affiliation-counter data=data limit=L] and [/affiliation-counter] disappears. You can format this content as any content of your website. The limit attribute is optional. If you don't use it, the content will not disappear:

[affiliation-counter data=data]
Data: [number][/affiliation-counter]

You can insert the [number] cotillion as many times as you want between [affiliation-counter data=data limit=L] and [/affiliation-counter]. If you don't insert it, Affiliation Manager allows you to schedule a content disappearance without displaying a counter:

[affiliation-counter data=data limit=L]
When the data reaches [limit], this sentence will disappear!
[/affiliation-counter]

You also can display a counter of the sum of several different data, with a cotillion like this:

[affiliation-counter data=data1+data2 limit=L]
Data: [number][/affiliation-counter]

15.1 Display Of Numbers And The Limit

You are not limited to the [number] cotillion. You can use the following cotillions:

The filter attribute (defined here) and the decimals attribute (defined here) are also available for these cotillions.

15.2 Automatic Content Substitution

If you want to schedule a content substitution, insert into your posts/pages/widgets a cotillion like this:

[affiliation-counter data=data limit=L]
Data: [number][after]The limit is reached.[/affiliation-counter]

by replacing L with a positive number.

Insert the content you want to substitute between [after] and [/affiliation-counter]. When the limit is reached, the content between [affiliation-counter data=data limit=L] and [after] disappears, and the content between [after] and [/affiliation-counter] appears. The content between [after] and [/affiliation-counter] is never sent to the browser until the limit is reached.

You can insert the [number] cotillion as many times as you want between [affiliation-counter data=data limit=L] and [/affiliation-counter]. If you don't insert it, Affiliation Manager allows you to schedule a content substitution without displaying a counter:

[affiliation-counter data=data limit=L]
The limit will be reached soon.
[after]The limit is reached.[/affiliation-counter]

15.3 Succession Of Counters

It is possible to specify several limits for the limit attribute, by separating the different limits by /, like this:

[affiliation-counter data=data limit=50/100]
The first limit will be reached soon.
[after]The second limit will be reached soon.
[after]The second limit has been reached.[/affiliation-counter]

You can use the following cotillions:

The filter attribute (defined here) and the decimals attribute (defined here) are also available for these cotillions.

15.4 The range Attribute

You can count only data recorded during a specific time range by using the range attribute, like this:

[affiliation-counter data=data range=range limit=L]
Data: [number][/affiliation-counter]

Replace range with:

16. Counters Of Affiliate's Performances

To display a counter of affiliate's performance, insert into your posts/pages/widgets a cotillion like this:

[affiliate-counter data=data limit=L id=N]
Performance: [number][/affiliate-counter]

or this one:

[affiliate-counter data=data limit=L referrer=referrer]
Performance: [number][/affiliate-counter]

by replacing L with a positive number, N with the ID of the affiliate, referrer with the login name or the PayPal email address of the affiliate and data with:

If you don't use neither the id attribute, nor the referrer attribute, the referrer attribute will automatically be set to:

When the performance reaches the limit L, the content between [affiliate-counter data=data limit=L referrer=referrer] and [/affiliate-counter] disappears. You can format this content as any content of your website. The limit attribute is optional. If you don't use it, the content will not disappear:

[affiliate-counter data=data referrer=referrer]
Performance: [number][/affiliate-counter]

You can insert the [number] cotillion as many times as you want between [affiliate-counter data=data limit=L referrer=referrer] and [/affiliate-counter]. If you don't insert it, Affiliation Manager allows you to schedule a content disappearance without displaying a counter:

[affiliate-counter data=data limit=L referrer=referrer]
When the performance will reach [limit], this sentence will disappear!
[/affiliate-counter]

You also can display a counter of the sum of several different performances, with a cotillion like this:

[affiliate-counter data=data1+data2 limit=L referrer=referrer]
Performance: [number][/affiliate-counter]

16.1 Display Of Numbers And The Limit

You are not limited to the [number] cotillion. You can use the following cotillions:

The filter attribute (defined here) and the decimals attribute (defined here) are also available for these cotillions.

16.2 Automatic Content Substitution

If you want to schedule a content substitution, insert into your posts/pages/widgets a cotillion like this:

[affiliate-counter data=data limit=L referrer=referrer]
Performance: [number][after]The limit is reached.[/affiliate-counter]

by replacing L with a positive number and referrer with the login name or the PayPal email address of the affiliate.

Insert the content you want to substitute between [after] and [/affiliate-counter]. When the performance reaches the limit L, the content between [affiliate-counter data=data limit=L referrer=referrer] and [after] disappears, and the content between [after] and [/affiliate-counter] appears. The content between [after] and [/affiliate-counter] is never sent to the browser until the limit is reached.

You can insert the [number] cotillion as many times as you want between [affiliate-counter data=data limit=L referrer=referrer] and [/affiliate-counter]. If you don't insert it, Affiliation Manager allows you to schedule a content substitution without displaying a counter:

[affiliate-counter data=data limit=L referrer=referrer]
The limit will be reached soon.
[after]The limit is reached.[/affiliate-counter]

16.3 Succession Of Counters

It is possible to specify several limits for the limit attribute, by separating the different limits by /, like this:

[affiliate-counter data=data limit=50/100 referrer=referrer]
The first limit will be reached soon.
[after]The second limit will be reached soon.
[after]The second limit has been reached.[/affiliate-counter]

You can use the following cotillions:

The filter attribute (defined here) and the decimals attribute (defined here) are also available for these cotillions.

16.4 The range Attribute

You can count only performances recorded during a specific time range by using the attribut range, like this:

[affiliate-counter data=data range=range limit=L referrer=referrer]
Performance: [number][/affiliate-counter]

Replace range with:

16.5 Default Referrer

You can specify no value for the referrer attribute. In this case, if you don't specify any value for the id attribute too, it is automatically set to:

17. Display Of The Options

To display an option of Affiliation Manager, insert into your posts/pages/widgets a cotillion like this:

[affiliation-manager option]

by replacing option with:

This list is not complete and has only the most relevant items. You can find all possible values of option in the initial-options.php file of Affiliation Manager.

Example:

Percentage of the level 1 commission: [affiliation-manager commission-percentage] %

Result:

Percentage of the level 1 commission: 40 %

17.1 The default Attribute

You can specify a text that will be displayed instead of the option when this one is empty, using the default attribute, like this:

[affiliation-manager option default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

17.2 The filter Attribute

You can specify a PHP function that will be applied to the option before this one is displayed, using the filter attribute, like this:

[affiliation-manager option filter=function]

Replace function by the name of the function you want to apply.

Sometimes, the option is an English word. You can translate it into the language of your website by entering i18n as the value for the filter attribute.

Example:

Type of commission: [affiliation-manager commission-type filter=i18n]

Result:

Type of commission: proportional

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[affiliation-manager option filter=function1/function2/…/functionN]

The functions will be applied in the specified order.

17.3 The decimals Attribute

When the option is a numeric data, you can choose the number of digits after the decimal point used to display it, using the decimals attribute, like this:

[affiliation-manager option decimals=value]

Replace value with:

18. Encryption Of URLs

You can deliver the bonuses of your affiliates using encrypted download URLs. The encryption key and the validity duration of encrypted URLs are configurable through the Options page of Affiliation Manager. Enter a random string (difficult to guess) into the Encryption key field.

To deliver the bonuses of your affiliates using encrypted download URLs, use the following cotillion:

[referrer bonus-download-url filter=encrypt-url]

instead of this one:

[referrer bonus-download-url]

If the bonus of your affiliate has several download URLs, use the following cotillion:

[referrer bonus-download-url part=1 filter=encrypt-url]

[referrer bonus-download-url part=2 filter=encrypt-url]

…

instead of this one:

[referrer bonus-download-url part=1]

[referrer bonus-download-url part=2]

…

In the Body field of your order confirmation email, you can insert a cotillion like this:

Click on the link below to download the bonus offered by your referrer, [referrer first-name] [referrer last-name]:

[referrer bonus-download-url filter=encrypt-url]

You have [commerce-manager encrypted-urls-validity-duration] hours to download it. Then this link will no longer be valid.

You can also insert the cotillion above into the Instructions to the customer field of the edit page of your affiliate, and insert the following cotillion into the Body field of your order confirmation email:

[referrer bonus-instructions]

19. Emails

You can insert cotillions into Sender, Receiver, Subject and Body fields of emails to display informations about the affiliate. These cotillions are simply the same as those presented in the Display Of Informations About The Affiliate section.

You can also insert in these fields all cotillions available on your website.

If you register the affiliate as a client, you can insert cotillions into these fields in order to display informations (login name and password for example) about the client. These cotillions are presented in this section.

If you register the affiliate to one or more of your members areas, you can insert cotillions into these fields in order to display informations (login name and password for example) about the member. These cotillions are presented in this section.

If you register the affiliate as a WordPress user, you can insert cotillions into these fields in order to display informations (login name and password for example) about the user. These cotillions are presented in this section.

You can set a Reply-To address by inserting a text like this one into the Sender field of emails:

Name <email@address>, Reply-To: Reply To Name <reply-to-email@address>

You can also enter several email addresses separated with commas in the Receiver field of emails. And you can insert HTML code into the Body field of emails.

20. Autoresponders

Affiliation Manager allows you to subscribe your affiliates to an autoresponder list. You must make the settings shown in this section so that it works.

For the following autoresponders, you must enter the ID of the list into the List field of the Autoresponders module:

For GetResponse, enter the TOKEN key of the list. For MailerLite, enter the ID of the group. You can get this information in this page by logging into your MailerLite account.

You can find the ID of a MailChimp list in the List name & defaults page.

You can allow the user to choose an autoresponder list by inserting a cotillion like this one into the Code field of your form:

<p><label><strong>List:</strong> [select autoresponder-list]
[option value=list1]List 1[/option]
[option value=list2]List 2[/option]
…
[option value=listN]List N[/option]
[/select]</label></p>

Replace list1, list2listN with the IDs or names of the lists.

You can also allow him to subscribe or not to an autoresponder list, by inserting a cotillion like this one into the Code field of your form:

<p><label>[input subscribed-to-autoresponder value=yes] Subscribe to this list</label></p>

20.1 AWeber

You must make some adjustments so that Affiliation Manager works with AWeber. You have two methods. If the first doesn't work, try the second.

First method:

Go to this page to get your authorization cotillion and copy it to the API key field in the AWeber module of the Options page. Affiliation Manager will automatically extract your API key from it when you click a button to update your options.

Second method:

Go to your AWeber account, place your pointer on List Options, click on Email Parsers in the dropdown list that appears and then click on add new at the bottom of the page.

AWeber Email Parser
AWeber Email Parser

Enter what you want into the Description field and insert this cotillion into the Trigger Rule field:

From:[^\n|.]+wordpress\@domain\.extension

by replacing domain with the domain name of your website (without the extension) and extension the extension of your domain name (without the dot).

If your domain name (with the extension) contains more than 35 characters, insert this cotillion into the Trigger Rule field instead of the previous cotillion:

From:[^\n|.]+w\@domain\.extension

Insert this cotillion into the Rule 1 field:

\n[>\s]*Email:\s+(.+?)\n

In the Store In field to the right of the Rule 1 field, select Email.

Insert this cotillion into the Rule 2 field:

\n[>\s]*Name:\s+(.+?)\n

In the Store In field to the right of the Rule 2 field, select Name.

Insert this cotillion into the Rule 3 field:

\n[>\s]*Referrer:\s+(.+?)\n

In the Store In field to the right of the Rule 3 field, select Ad Tracking.

Click on Save to record your parser. Then edit it, check the Enable parser for all lists in this account box and click on Save to enable your parser for all lists of your AWeber account.

20.2 CyberMailing

You have no adjustment to make so that Affiliation Manager works with CyberMailing, but do not enable the protection against bots.

20.3 GetResponse

You must enter the API key of your GetResponse account in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with GetResponse. You can get your API key by logging into your GetResponse account.

20.4 MailChimp

You must enter the API key of your MailChimp account in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with MailChimp. You can get your API key by logging into your MailChimp account.

20.5 MailerLite

You must enter the API key of your MailerLite account in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with MailerLite. You can get your API key in this page by logging into your MailerLite account.

20.6 Sendinblue

You must enter the API key of your Sendinblue account in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with Sendinblue. You can get your API key by logging into your Sendinblue account.

20.7 Sendy

You must enter the URL of your Sendy installation and your API key in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with Sendy. You can get your API key in the Settings page of Sendy.

20.8 SG Autorépondeur

You must enter the ID of your SG Autorépondeur account and your activation cotillion in the Autoresponders integration module of the Options page of Affiliation Manager so that Affiliation Manager works with SG Autorépondeur. You can get these informations by logging into your SG Autorépondeur account.

If it doesn't work, make sure the cURL extension is enabled on the server that hosts your website.

21. Registration As A Client

You can register your affiliates as clients, if you have installed and activated Commerce Manager. The Autoresponders, Membership, WordPress and Custom instructions modules of Affiliation Manager supersede the modules of the same name in Commerce Manager.

If the user registers to your affiliate program while logged in as a client, or by specifying an email address identical to that of an existing client, Affiliation Manager will not create a new client account, but will update the category of the client, if you want to assign the affiliate to a client category.

The client's login name of the affiliate is his affiliate's login name, if there is no client with the same login name. Otherwise, a number will be added to the end.

You can give to the affiliate his login name and his password, by inserting a cotillion like this one in the Body field of your registration confirmation email:

Your login name: [client login]
Your password: [client password default="the same as before"]

The affiliate can always change his login name and password through the profile form of Commerce Manager.

You can insert cotillions into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the client. These cotillions are presented in this section.

The connection as an affiliate automatically creates a connection as a client if the affiliate also has a client account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as a client automatically creates a connection as an affiliate.

22. Membership

You can register your affiliates to one or more of your members areas, if you have installed and activated Membership Manager. The Autoresponders, Registration as a client, WordPress and Custom instructions modules of Affiliation Manager supersede the modules of the same name in Membership Manager.

If the user registers to your affiliate program while logged in as a member, or by specifying an email address identical to that of an existing member, Affiliation Manager will not create a new member account, but will update the account of the member. It will also update the category of the member, if you want to assign the affiliate to a member category.

The member's login name of the affiliate is his affiliate's login name, if there is no member with the same login name. Otherwise, a number will be added to the end.

You can give to the affiliate his login name and his password, by inserting a cotillion like this one in the Body field of your registration confirmation email:

Your login name: [member login]
Your password: [member password default="the same as before"]

The affiliate can always change his login name and password through the profile form of Membership Manager.

You can insert cotillions into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the member. These cotillions are presented in this section.

The connection as an affiliate automatically creates a connection as a member if the affiliate also has a member account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as a member automatically creates a connection as an affiliate.

23. WordPress

You can register your affiliates as WordPress users. Upon registration, the user's login name of the affiliate is his affiliate's login name, if there is no WordPress user with the same login name. Otherwise, a number will be added to the end.

If the user registers to your affiliate program while logged in as a WordPress user, or by specifying an email address identical to that of an existing WordPress user, Affiliation Manager will not create a new WordPress user account.

You can give to the affiliate his login name and his password, by inserting a cotillion like this one in the Body field of your registration confirmation email:

Your login name: [user login]
Your password: [user password]

You can insert cotillions into the Sender, Receiver, Subject and Body fields of registration confirmation/notification emails in order to display informations about the user. These cotillions are presented in the Display Of Informations About The User section.

The connection as a WordPress user automatically creates a connection as an affiliate, if the user is not an administrator (or editor), also has an affiliate account and if the email addresses of the two accounts are identical. And under the same conditions, the connection as an affiliate automatically creates a connection as a WordPress user.

24. Display Of Informations About The User

To display an information about a WordPress user, insert into your posts/pages/widgets a cotillion like this:

[user information]

by replacing information with:

Example:

Your login name: [user login]

24.1 The default Attribute

You can specify a text that will be displayed instead of the information when this one is empty (this is generally the case when the user is not logged in as a WordPress user), using the default attribute, like this:

[user information default="text"]

Don't forget to include the quotes at the beginning and the end of the default value.

24.2 The filter Attribute

You can specify a PHP function that will be applied to the information before this one is displayed, using the filter attribute, like this:

[user information filter=function]

Replace function by the name of the function you want to apply.

It is possible to specify several functions for the filter attribute, by separating the different functions by /, like this:

[user information filter=function1/function2/…/functionN]

The functions will be applied in the specified order.

25. Custom Instructions

You can add custom instructions that will be executed just after the registration of an affiliate, or other events. This allows you, among other things, to subscribe the affiliate to a list of an autoresponder that is not yet supported by Affiliation Manager.

Some PHP skills are required. In the PHP code field, you can enter a PHP code or the path (relative to the directory in which your wp-config.php file is located) of a PHP file on your website. In the latter case, it's the PHP code of this file that will be executed.

The custom instructions (for the registration of an affiliate) are executed inside the includes/add-affiliate.php file of Affiliation Manager. You can find where the custom instructions of other events are executed by opening all files of Affiliation Manager with a text editor like Notepad++ and searching for the string of characters eval( in these files.

The custom instructions of form submission are executed inside the includes/forms/processing.php file of Affiliation Manager. You can execute different instructions depending on the form by doing a test on the $id variable set in the forms.php file of Affiliation Manager.

26. Display Of Forms

Insert into your posts/pages/widgets the cotillion:

The login form, the password reset form and the registration form appear only if the user is not logged as an affiliate. The other forms appear only if the user is logged as an affiliate.

The affiliate can also login by entering his email address instead of his login name, and reset his password by entering his login name instead of his email address.

If you use Affiliation Manager on a non-WordPress static website, you must insert, between the <head> and </head> tags, this line of cotillion in the PHP file of the page that displays the statistics form:

<link rel="stylesheet" type="text/css" media="screen" href="<?php echo affiliation_url('libraries/date-picker.css'); ?>" />

To understand how to create your pages relating to affiliation, refer to this section.

26.1 Redirection

You can redirect the user to a page of your choice when he completed the form, by using the redirection attribute:

[affiliation-login-form redirection=URL]

Replace URL with the URL to which you want to redirect the user.

The redirection attribute is available for all the forms cotillions.

You can also redirect the user to a specific part of the page where he submitted the form, like this:

[your-cotillion-of-form redirection=#your-anchor]

To redirect the user to the top of the form, simply enter # as the value for the redirection attribute:

[your-cotillion-of-form redirection=#]

You can also redirect the user to the page he saw just before the current page, if this page belongs to your website, by entering referring-url as the value for the redirection attribute:

[your-cotillion-of-form redirection=referring-url]

If the user just attempted to access a page restricted to affiliates but has been redirected to a login page because he was not logged in, you can redirect him to this private page when he's logged in, by entering private-page as the value for the redirection attribute:

[affiliation-login-form redirection=private-page]

26.2 Automatic Positioning Of The Cursor

You can decide, for each of your forms, if the cursor is or not automatically positioned in the first field when the page loads. Insert into your posts/pages/widgets a cotillion like this:

[your-cotillion-of-form focus=yes]

26.3 Automatic Completion Of Fields

You can significantly improve your conversion rate by automatically completing form fields with informations from the user when the page loads. Affiliation Manager allows you to do this when the page link has been sent through an autoresponder, by you or one of your affiliates.

To do this, simply add:

Example 1 (automatic completion of the first name):

https://www.kleor.com/affiliation/registration/?first-name=John

Example 2 (automatic completion of the email address):

https://www.kleor.com/affiliation/registration/?email-address=johnsmith@kleor.com

Example 3 (automatic completion of the first name and the email address):

https://www.kleor.com/affiliation/registration/?first-name=John&email-address=johnsmith@kleor.com

Use the dynamic tags provided by your autoresponder to automatically complete the fields.

26.4 Attributes

All attributes (except action, id and name) of the <form> HTML tag are also available for the cotillions that display a form, with an identical role.

27. Creation Of Forms

You can customize the forms through the Front Office page of Affiliation Manager. To customize a form, you must insert into the Code field of this form a special cotillion.

This cotillion is very similar to a normal HTML code, with the exception of the following characteristics:

27.1 The [input] Cotillion

Insert into the Code field a cotillion like this:

[input name]

by replacing name with:

Example:

<p><label><strong>Your first name:</strong> [input first-name]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a field allowing the user to enter his first name, a field allowing him to enter his email address, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[input your-name]

27.2 Attributes Of The [input] Cotillion

All attributes (except id and name) of the <input /> HTML tag are also available for the [input] cotillion, with an identical role.

Example:

<p><label><strong>Your first name:</strong> [input first-name size=20]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address size=30]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a field (width of 20 characters) allowing the user to enter his first name, a field (width of 30 characters) allowing him to enter his email address, and a button allowing him to submit the form.

You can use the pattern HTML5 attribute to specify a syntax that the field must respect. In your regular expression, replace the [ and ] characters with their corresponding HTML entities: &#91; and &#93;.

Example:

<p><label><strong>Postcode:</strong> 
[input postcode pattern="&#91;0-9&#93;{5,5}" size=20]<br />
[error postcode]</label></p>
<div>[input submit value="Submit"]</div>

27.3 The [textarea] Cotillion

Insert into the Code field a cotillion like this:

[textarea name]Content[/textarea]

by replacing Content with the content you want display in the text area before the user completes the form and name with:

Example:

<p><label><strong>Your first name:</strong> [textarea first-name][/textarea]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [textarea email-address][/textarea]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a text area allowing the user to enter his first name, a text area allowing him to enter his email address, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[textarea your-name]Content[/textarea]

27.4 Attributes Of The [textarea] Cotillion

All attributes (except id and name) of the <textarea> HTML tag are also available for the [textarea] cotillion, with an identical role.

Example:

<p><label><strong>Your first name:</strong> [textarea first-name cols=20 rows=1][/textarea]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [textarea email-address cols=30 rows=1][/textarea]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a text area (20 columns and 1 row) allowing the user to enter his first name, a text area (30 columns and 1 row) allowing him to enter his email address, and a button allowing him to submit the form.

27.5 The [select] Cotillion

The [select] cotillion has the same role as the <select> HTML tag. Insert into the Code field a cotillion like this:

[select name]Content[/select]

by replacing name with:

Example:

<p><label><strong>your pays:</strong> [select country]
[option]Canada[/option]
[option]France[/option]
[option]Ireland[/option]
[/select]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a dropdown list allowing the user to select his country, and a button allowing him to submit the form.

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[select your-name]Content[/select]

To display easily a dropdown list allowing the user to select a country, insert into the Code field the cotillion below:

[country-selector]

And to display into the registration form a dropdown list allowing the user to choose his category, insert into the Code field the cotillion below:

[category-selector]

27.6 Attributes Of The [select] Cotillion

All attributes (except id and name) of the <select> HTML tag are also available for the [select], [category-selector] and [country-selector] cotillions, with an identical role.

27.7 The [option] Cotillion

The [option] cotillion has the same role as the <option> HTML tag. Insert into the Code field a cotillion like this:

[option value="Value of the option"]Name of the option[/option]

If the name and the value of the option are identical, you can also insert into the Code field a cotillion like this:

[option]Name of the option[/option]

Example:

<p><label><strong>your pays:</strong> [select country]
[option]Canada[/option]
[option]France[/option]
[option]Ireland[/option]
[/select]</label></p>
<div>[input submit value="Submit"]</div>

The above cotillion displays a form containing a dropdown list allowing the user to select his country, and a button allowing him to submit the form.

27.8 Attributes Of The [option] Cotillion

All attributes of the <option> HTML tag are also available for the [option] cotillion, with an identical role.

27.9 Required Fields

By default, all form fields are optional. To insert a required field, use a cotillion like this:

[input name required=yes]

by replacing name with one element of this list.

The required attribute is also available for the [textarea], [select] and [country-selector] cotillions.

27.10 Error Messages

When the user does not complete one of the required fields of the form, or enters an invalid email address, error messages are displayed. You can customize these messages through the Options page of Affiliation Manager or through the interface of Affiliation Manager.

Insert into the Code field a cotillion like this:

[error name]

by replacing name with:

Example:

<p><label><strong>Your first name:</strong> [input first-name]<br />[error first-name]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address]</label></p>
<div>[input submit value="Submit"]</div>

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[error your-name]

To display the error messages in red, add this cotillion to your CSS stylesheet:

.error { color: #c00000; }

27.11 Attributes Of The [error] Cotillion

All attributes (except id) of the <span> HTML tag are also available for the [error] cotillion, with an identical role.

You can set different error messages for each field of a form, like this:

[error field data-name-message="Your error message"]

by replacing name with:

Example:

<p><label><strong>Your first name:</strong> [input first-name required=yes]<br />[error first-name data-unfilled-field-message="The first name is required."]</label></p>
<p><label><strong>Your email address:</strong> [input email-address]<br />[error email-address data-invalid-email-address-message="The email address is invalid."]</label></p>
<div>[input submit value="Submit"]</div>

27.12 The [label] Cotillion

The [label] cotillion has the same role as the <label> cotillion. Insert into the Code field a cotillion like this:

[label name]Content[/label]

by replacing name with:

Example:

<p>[label first-name]<strong>Your first name:</strong>[/label] [input first-name]<br />[error first-name]</p>
<p>[label email-address]<strong>Your email address:</strong>[/label] [input email-address]<br />[error email-address]</p>
<div>[input submit value="Submit"]</div>

Outside the standard names listed above, you can also replace name with the name you want, provided it contains only lowercase letters, numbers and hyphens, like this:

[label your-name]Content[/label]

27.13 Attributes Of The [label] Cotillion

All attributes (except for) of the <label> HTML tag are also available for the [label] cotillion, with an identical role.

27.14 CAPTCHAs

You can use CAPTCHAs in forms. Insert into the Code field a cotillion like this:

[captcha type=type]

by replacing type with:

To use a CAPTCHA of the reCAPTCHA type, you must get a site key and a secret key here and enter these keys in the CAPTCHA module of the Options page of Affiliation Manager.

The CAPTCHA of the reCAPTCHA v3 type is invisible. For the CAPTCHA of the reCAPTCHA v2 type, you can choose the theme you want to use, like this:

[captcha type=recaptcha theme=theme]

by replacing theme with:

To use a CAPTCHA of the hCaptcha type, you must get a site key and a secret key here and enter these keys in the CAPTCHA module of the Options page of Affiliation Manager.

You can choose the theme you want to use, like this:

[captcha type=hcaptcha theme=theme]

by replacing theme with:

Example 1 (CAPTCHA of the reCAPTCHA v2 type):

[captcha type=recaptcha theme=dark]

Example 2 (CAPTCHA of the reCAPTCHA v3 type, invisible):

[captcha type=recaptcha3]

Example 3 (CAPTCHA of the Arithmetic operation type):

<p>[captcha type=arithmetic] = [input captcha size=3] (enter your answer in digits)</p>

Example 4 (CAPTCHA of the Reversed string type):

<p>Type the following characters in reverse order:<br />
[captcha type=reversed-string] : [input captcha size=20]</p>

Example 5 (CAPTCHA of the Question type):

<p>[captcha type=question question="Question" answer="Correct answer"] [input captcha size=20]</p>

27.15 Attributes Of The [captcha] Cotillion

All attributes of the <span> HTML tag are also available for the [captcha] cotillion, with an identical role, only if you don't use a CAPTCHA of the reCAPTCHA type.

27.16 Double Entry

You can require the double entry of a form field (email address, password…), like this:

[input confirm-name]

by replacing name with the name of the field that the user must enter a second time.

Example:

<p><label><strong>Your email address:</strong>*<br />
[input email-address size=40 required=yes]<br />[error email-address]</label></p>

<p><label><strong>Confirm your email address:</strong><br />
[input confirm-email-address size=40]<br />[error confirm-email-address]</label></p>

27.17 Current Password

You can require that the affiliate enters his current password to change his profile or preferences, like this:

[input current-password]

Example:

<p><label><strong>Your current password:</strong>*<br />
[input current-password size=30 required=yes]<br />
[error current-password data-invalid-field-message="The password you entered is incorrect."]</label></p>

27.18 The Submit Button

To display a button allowing the user to submit the form, insert into the Code field a cotillion like this:

[input submit value="Text of the button"]

by replacing Text of the button with the text of your button.

If you want to use an image, insert a cotillion like this:

[input submit type=image src="URL of the image" alt="Alternative text"]

by replacing URL of the image with the image URL of your button and Alternative text with the text displayed when the image can not be displayed.

You can also use the <button> HTML tag, like this:

<button type="submit">Text of the button</button>

27.19 The [validation-content] Cotillion

To display a content restricted to users who have submitted the form without any error, insert into the Code field a cotillion like this:

[validation-content]Content displayed if the user has submitted the form without any error[/validation-content]

You can also define a content that will be displayed if the user has submitted the form and at least one error was generated, like this:

[validation-content]
Content displayed if the user has submitted the form without any error[other]
Content displayed if the user has submitted the form and at least one error was generated
[/validation-content]

Example:

[validation-content]
<p style="color: green;">Your profile has been changed successfully.</p>
[other]<p style="color: red;">[error unavailable-login] [error numeric-login] [error too-short-login] [error too-long-login] [error too-short-password] [error too-long-password] [error unavailable-email-address] [error unfilled-fields] [error invalid-captcha]</p>
[/validation-content]

You can also define a content that will be displayed if the user has not submitted the form, like this:

[validation-content]
Content displayed if the user has submitted the form without any error[other]
Content displayed if the user has submitted the form and at least one error was generated[other]
Content displayed if the user has not submitted the form
[/validation-content]

27.20 The [indicator] Cotillion

You can tell the user if the login name he chooses is available or not when he completes the registration form or the profile form. Insert into the Code field the cotillion below:

[indicator login]

To indicate the availability of his email address, insert the cotillion below:

[indicator email-address]

To indicate the availability of his PayPal email address, insert the cotillion below:

[indicator paypal-email-address]

And to indicate the strength of the password he chose, insert the cotillion below:

[indicator password]

You can customize the messages displayed by the indicators through the interface of Affiliation Manager.

27.21 Attributes Of The [indicator] Cotillion

All attributes (except id) of the <span> HTML tag are also available for the [indicator] cotillion, with an identical role.

28. Display Of Statistics

Insert into your posts/pages/widgets the cotillion:

For example, this cotillion allows you to display most of the statistics of the affiliate:

[affiliation-statistics-form redirection=#]

<div id="statistics">
[affiliation-global-statistics]
[affiliation-clicks-statistics]
[affiliation-commissions-statistics]
[affiliation-prospects-commissions-statistics]
[affiliation-messages-commissions-statistics]
</div>

To understand how to create your pages relating to affiliation, refer to this section.

29. Personalization Of Statistics

You can customize the statistics provided to affiliates through the Statistics module of the Front Office page of Affiliation Manager. You can enter into the Code field some HTML code and all the cotillions available on your website.

29.1 The [if] Cotillion

To display a content only if a condition is verified, insert into the Code field a cotillion like this:

[if condition]Content displayed only if the condition is verified[/if]

by replacing condition with:

You can also define a content that will be displayed if the condition is not verified, like this:

[if condition]
Content displayed only if the condition is verified
[else]Content displayed only if the condition is not verified[/if]

Example:

[if click]
<p>Number of clicks: [affiliate-counter data=clicks range=form][number][/affiliate-counter]</p>
[else]<p>No clicks</p>[/if]

29.2 The [foreach] Cotillion

To repeat a content for each item of a list, insert into the Code field a cotillion like this:

[foreach list]Content repeated for each item of the list[/foreach]

by replacing list with:

Example:

[foreach click]
<tr>
<td>[click date]</td>
<td>[click url filter=htmlspecialchars]</td>
<td>[click referring-url filter=htmlspecialchars]</td>
</tr>[/foreach]

When you don't use the id attribute of a cotillion, it is automatically set to the IDs of each item of the list.

By default, the items are sorted by date descending. You can sort them differently by using the orderby and order attributes that work as in the SQL language.

Example:

[foreach click orderby=id order=asc]
<tr>
<td>[click date]</td>
<td>[click url filter=htmlspecialchars]</td>
<td>[click referring-url filter=htmlspecialchars]</td>
</tr>[/foreach]

In this example, the clicks are sorted by ID ascending. You can find all possible values of the orderby attribute in the tables.php file of Affiliation Manager.

29.3 The status Attribute

The status is available for the [if] and [foreach] cotillions and allows you to count only the items corresponding to a certain status, like this:

[if condition status=status]Content[/if]
[foreach list status=status]Content repeated for each item of the list[/foreach]

Example (statistics of processed and unrefunded orders):

[if order status=processed]
<table style="width: 100%;">
<tr style="vertical-align: top;">
<th>Date</th>
<th>Product</th>
<th>Amount</th>
</tr>
[foreach order status=processed]
<tr style="vertical-align: top;">
<td>[order date]</td>
<td><a href="[product url filter=htmlspecialchars]">[product name]</a></td>
<td>[order amount] [commerce-manager currency-code]</td>
</tr>[/foreach]
</table>
[else]<p>No orders</p>[/if]

The status attribute can take the following values:

30. Instant Notifications

You can send notifications to your affiliates when they refer an affiliate, a client, an order, a recurring payment, a member, a prospect or a message. To allow your affiliates to choose their preferences of notifications, insert this cotillion into your posts/pages/widgets:

[affiliation-instant-notifications-form]

You can customize the sender, the receiver, the subject and the body of emails through the Instant Notifications page of Affiliation Manager. When you disable the sending of a notification, this one is never sent to the affiliates regardless of their preferences.

You can customize the instant notifications forms through the Front Office page of Affiliation Manager. Here is a sample cotillion allowing the affiliate to choose all his preferences of instant notifications:

[validation-content]<p style="color: green;">Your preferences has been changed successfully.</p>
[other]<p style="color: red;">[error unfilled-fields] [error invalid-captcha]</p>[/validation-content]

<table style="width: 100%;">

<tr style="vertical-align: top;"><td><strong>[label affiliate-notification-email-sent]Send me an email when I refer an affiliate[/label]</strong></td>
<td>[select affiliate-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label client-notification-email-sent]Send me an email when I refer a client[/label]</strong></td>
<td>[select client-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label order-notification-email-sent]Send me an email when I refer an order[/label]</strong></td>
<td>[select order-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commission amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label recurring-payment-notification-email-sent]Send me an email when I refer a recurring payment[/label]</strong></td>
<td>[select recurring-payment-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commission amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label member-notification-email-sent]Send me an email when I refer a member[/label]</strong></td>
<td>[select member-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label prospect-notification-email-sent]Send me an email when I refer a prospect[/label]</strong></td>
<td>[select prospect-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commission amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label message-notification-email-sent]Send me an email when I refer a message[/label]</strong></td>
<td>[select message-notification-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commission amount is not 0[/option]
[/select]</td></tr>

</table>
<div style="text-align: center;">[input submit value="Submit"]</div>

31. Periodic Reports

You can send to your affiliates periodic reports about their commissions. To allow your affiliates to choose their preferences of periodic reports, insert this cotillion into your posts/pages/widgets:

[affiliation-periodic-reports-form]

You can customize the sender, the receiver, the subject and the body of emails through the Periodic Reports page of Affiliation Manager. When you disable the sending of a report, this one is never sent to the affiliates regardless of their preferences.

You can use the [isoyear], [month], [monthday], [weekday], [year], [yearday] and [yearweek] cotillions described in the Time And Date section of the Easy Timer's documentation, in order to display the start date and the end date of the period, like this:

Here is your commissions report for the period from [monthday date=start] [month date=start] [year date=start] to [monthday date=end] [month date=end] [year date=end].

If the sending of a periodic report is scheduled on a date that does not exist (29, 30 or 31 of a month), this report will be sent on the last day of the month.

You can customize the periodic reports forms through the Front Office page of Affiliation Manager. Here is a sample cotillion allowing the affiliate to choose all his preferences of periodic reports:

[validation-content]<p style="color: green;">Your preferences has been changed successfully.</p>
[other]<p style="color: red;">[error unfilled-fields] [error invalid-captcha]</p>[/validation-content]

<p>You can receive periodic reports about your commissions. Select the reports you want to receive:</p>

<table style="width: 100%;">

<tr style="vertical-align: top;"><td><strong>[label weekly-report-email-sent]Weekly reports[/label]</strong></td>
<td>[select weekly-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label bimonthly-report-email-sent]Bimonthly reports[/label]</strong></td>
<td>[select bimonthly-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label monthly-report-email-sent]Monthly reports[/label]</strong></td>
<td>[select monthly-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label bimestrial-report-email-sent]Bimestrial reports[/label]</strong></td>
<td>[select bimestrial-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label trimestrial-report-email-sent]Trimestrial reports[/label]</strong></td>
<td>[select trimestrial-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label quadrimestrial-report-email-sent]Quadrimestrial reports[/label]</strong></td>
<td>[select quadrimestrial-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label semestrial-report-email-sent]Semestrial reports[/label]</strong></td>
<td>[select semestrial-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

<tr style="vertical-align: top;"><td><strong>[label yearly-report-email-sent]Yearly reports[/label]</strong></td>
<td>[select yearly-report-email-sent]
[option value=yes]Yes[/option]
[option value=no]No[/option]
[option value="if commission"]If the commissions amount is not 0[/option]
[/select]</td></tr>

</table>
<div style="text-align: center;">[input submit value="Submit"]</div>

32. Creation Of Your Pages Relating To Affiliation

This section explains with examples how to create your pages relating to affiliation (registration page, registration confirmation page, password reset page, login page, profile edit page…). You can create these pages with a single click through the Front Office page of Affiliation Manager.

To know and understand all the cotillions used, refer to the Contents Restricted To Affiliates, Pages Restricted To Affiliates, Display Of Informations About The Affiliate, Display Of The Options, Display Of Forms and Display Of Statistics sections.

The creation of pages relating to affiliation needs custom fields. If you don't see the module of custom fields, follow these instructions, or click on Screen Options at the top right of the page and check the Custom fields box in order to display it.

32.1 Your Registration Page

To allow users to register to your affiliate program, create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as an affiliate (URL of the affiliates home page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

<p>Registration to the affiliate program is fast and free!</p>

[affiliation-registration-form]

The [affiliation-registration-form] cotillion displays the registration form.

32.2 Your Registration Confirmation Page

When a user registers to your affiliate program, he's redirected to a registration confirmation page. You can customize the URL of this page through the Options page of Affiliation Manager.

32.3 Your Password Reset Page

Your affiliates can forget their password. To allow them to reset it, create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as an affiliate (URL of the affiliates home page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

<p>If you have forgotten your password, you can reset it and your new password will be sent by email.</p>

[affiliation-password-reset-form]

<p style="text-align: center;"><a href="URL of the registration page">Register</a> | <a href="URL of the login page">Login</a></p>

The [affiliation-password-reset-form] cotillion displays the password reset form.

32.4 Your Login Page

To allow your affiliates to login, create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's logged in as an affiliate (URL of the affiliates home page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

[affiliation-login-form]

<p style="text-align: center;"><a href="URL of the registration page">Register</a> | <a href="URL of the password reset page">Lost password</a></p>

The [affiliation-login-form] cotillion displays the login form.

32.5 Your Logout Page

You can create a logout page with a custom redirection URL. Create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection action=logout url=URL]

by replacing URL with the URL to which you want to redirect the user.

Access to this page will have the effect of logout the affiliate and redirect him to the specified URL.

32.6 Your Affiliates Home Page

When your affiliates login, you can redirect them to a page that explains them your affiliate program. Create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=!session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's not logged in as an affiliate (URL of the login page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

<h2>Your Affiliate Links</h2>

<p>To get one of your affiliate links, simply add:</p>

<ul>
<li><em>?[affiliation-manager url-variable-name]=[affiliate login]</em> to any URL of Name of your website containing neither the <em>?</em> character, nor the <em>#</em> character</li>
<li><em>&[affiliation-manager url-variable-name]=[affiliate login]</em> to any URL of Name of your website containing the <em>?</em> character, but not the <em>#</em> character</li>
</ul>

<p><strong>Example:</strong></p>

<p><a href="URL of the home page of your website?[affiliation-manager url-variable-name]=[affiliate login]">URL of the home page of your website?[affiliation-manager url-variable-name]=[affiliate login]</a></p>

<p>With only one of your affiliate links (no matter which one), you can get commissions for all products marketed by Name of your website.</p>

<h2>Your Commissions</h2>

<p>Your commission percentage (level 1): [affiliate commission-percentage] %</p>

<p>Your commission percentage (level 2): [affiliate commission2-percentage] %</p>

<p>You receive a commission of [affiliate commission-percentage] % of each sale made through you and a commission of [affiliate commission2-percentage] % of each sale made through an affiliate referred by you. To receive your commissions, you need a Premier or Business <a href="/paypal">PayPal</a> account. Upgrade your PayPal account if you have a Personal account.</p>

32.7 Your Profile Edit Page

To allow your affiliates to edit their personal informations, create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=!session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's not logged in as an affiliate (URL of the login page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

<p style="text-align: center;">[affiliate-data-download-link text="Download your personal data"]</p>

<p>You can edit your personal informations. Fields marked with * are required.</p>

[affiliation-profile-form]

The [affiliation-profile-form] cotillion displays the profile form.

32.8 Your Statistics Page

To allow your affiliates to view their statistics, create a new page in WordPress. In the edit page of this page, create the affiliation custom field and enter as the value a cotillion like this:

[affiliation-redirection condition=!session url=URL]

by replacing URL with the URL to which you want to redirect the user if he's not logged in as an affiliate (URL of the login page for example).

In the text area of this page, through the Text tab, enter a cotillion like this:

<p>Enter a start date and an end date in the <em>YYYY-MM-DD</em> format, and click on <em>Display</em> to view your statistics.</p>

<div style="text-align: center;">
[affiliation-statistics-form redirection=#]
</div>

<div id="statistics">
[affiliation-global-statistics]
[affiliation-commissions-statistics]
</div>

The [affiliation-statistics-form] cotillion displays the statistics form. The [affiliation-global-statistics] and [affiliation-commissions-statistics] cotillions display the global statistics, and the statistics of commissions.

32.9 Your Menu

To facilitate the navigation of your affiliates in the pages that are restricted to them, you can display a navigation menu into these pages. Insert this cotillion:

[affiliation-pages-menu]

You can customize this navigation menu through the Menu module of the Front Office page of Affiliation Manager.

33. GDPR

The GDPR, which came into force on May 25, 2018, introduces the right to portability, which offers individuals the ability to receive their personal data, in a structured, commonly used and machine-readable format.

To allow your affiliates to download a CSV file containing their personal data, insert into one of the pages of your affiliate area a cotillion like this:

[affiliate-data-download-link text="Download your personal data"]

Don't forget to include the quotes at the beginning and the end of the value of the text attribute.

33.1 Attributes Of The [affiliate-data-download-link] Cotillion

All attributes (except href) of the <a> HTML tag are also available for the [affiliate-data-download-link] cotillion, with an identical role.

34. Custom Fields

You can, through the Back Office page of Affiliation Manager, add an unlimited number of custom fields in the Add Affiliate, Add Affiliate Category and Add Click pages to record additional data. Enter a name and a key for each custom field.

For example, if you want to save the favorite color of the affiliate, enter Favorite color as the name and favorite-color as the key.

To display a custom information about an affiliate, insert into your posts/pages/widgets a cotillion like this (don't forget the custom-field- prefix just before the key):

[affiliate custom-field-key]

by replacing key with the key of the custom field.

To allow the affiliate to fill this field, insert into the Code field of your forms a cotillion like this (don't forget the custom-field- prefix just before the key):

[input custom-field-key]

by replacing key with the key of the custom field.

35. Non-WordPress Static Websites

Affiliation Manager is designed to work with a WordPress site, but you can also use it with a non-WordPress static website, by following the instructions below.

35.1 Installation Of WordPress

Download WordPress and install it on your website. You will not use WordPress as a CMS to manage the pages of your website, but as an interface allowing you to manage your affiliate program.

35.2 The Files Of Your Website

If the files of your website have the extension .htm or .html, replace it with .php. Open them with a text editor like Notepadd++, click on File, and then click on Save as…. A window opens. In the Type field, select PHP and click on Save.

You can also recreate these files with this model.

35.3 Loading Of WordPress

To load the WordPress functions in the files of your website, add on top of these files the following cotillion:

<?php
$wordpress_directory = 'WordPress directory';
$file = $wordpress_directory.'/wp-load.php';
while (strstr($file, '//')) { $file = str_replace('//', '/', $file); }
if (substr($file, 0, 1) == '/') { $file = substr($file, 1); }
$i = 0; while ((!file_exists($file)) && ($i < 8)) { $file = '../'.$file; $i = $i + 1; }
include_once $file;
?>

Replace WordPress directory with the name of the directory where you installed WordPress. If you installed it at the root of your website, replace this line:

$wordpress_directory = 'WordPress directory';

by this one:

$wordpress_directory = '';

Insert this line of cotillion:

<?php wp_head(); ?>

just before the </head> tag, and this line of cotillion:

<?php wp_footer(); ?>

just before the </body> tag.

35.4 Use Of Cotillions

The documentation of Affiliation Manager provides you several cotillions. To use these cotillions in the PHP files of your website, insert a cotillion like this:

<?php echo do_shortcode('[your-cotillion]'); ?>

36. Advanced Customization

36.1 Navigation Menu

You can display a different navigation menu for the affiliates. Create your menu through the Menus page of the Appearance menu in WordPress (Appearance => Menus). For each item of your menu, select what you want for the Visibility field.

For more flexibility, you can instead use Menu Item Visibility Control. Create your menu through the Menus page of the Appearance menu in WordPress (Appearance => Menus). For each item of your menu, enter affiliation_session() as the value for the Visibility field if you want that this item appears only if the user is logged in as an affiliate. Or enter !affiliation_session() as the value if you want that this item appears only if the user is not logged in as an affiliate.

Without Menu Item Visibility Control, you can also do it like this:

Through the Menus page of the Appearance menu in WordPress (Appearance => Menus), create a menu for the affiliates and a menu for the other users.

In your WordPress theme (most often in the header.php file), you should find one or several lines containing a call to the wp_nav_menu function, like this:

wp_nav_menu(array( … ));

Immediately after array(, add this cotillion:

'menu' => (((function_exists('affiliation_session')) && (affiliation_session())) ? M : N),

Replace M with the ID of the menu for the affiliates, and N with the ID of the menu for the other users. The ID of a menu is the number located at the end of the URL of the page allowing to edit it.

You should get a cotillion like this:

wp_nav_menu(array('menu' => (((function_exists('affiliation_session')) && (affiliation_session())) ? M : N)… ));

36.2 Generation And Evaluation Of Passwords

Affiliation Manager has several functions for generating passwords and evaluating their strength. These functions are defined in the libraries/passwords-functions.php file of the plugin. You can replace them with your own functions by creating a plugin containing all of the following functions:

<?php function kleor_generate_password($length = 0) {
$length = (int) $length; if ($length <= 0) { $length = 12; }
$characters = 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ01234567890123456789()[]{}-+=*.!?,:@#$%&';
$minimum_strength = min(64, $length*(3 + log($length, 2)) - ($length == 1 ? 2 : 3));
$n = 0; $best_password = ''; $best_strength = 0;
while (($n < 8) && ($best_strength < $minimum_strength)) {
$password = ''; for ($i = 0; $i < $length; $i++) { $password .= substr($characters, mt_rand(0, 79), 1); }
if ((function_exists('strip_shortcodes')) && ($password != strip_shortcodes($password))) { $password = str_replace('[', '(', $password); }
$n += 1; $strength = kleor_password_strength($password);
if ($strength > $best_strength) { $best_strength = $strength; $best_password = $password; } }
return $best_password; }


function kleor_generate_password_js() { ?>
<script>
function kleor_generate_password(length) {
var length = parseInt(length); if (length <= 0) { length = 12; }
var characters = 'bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ01234567890123456789()[]{}-+=*.!?,:@#$%&';
if (length == 1) { var minimum_strength = 1; }
else { var minimum_strength = Math.min(64, length*(3 + (Math.log(length))/Math.LN2) - 3); }
var n = 0; var best_password = ''; var best_strength = 0;
while ((n < 8) && (best_strength < minimum_strength)) {
var password = ''; for (i = 0; i < length; i++) { password += characters.substr(Math.floor(80*Math.random()), 1); }
n += 1; strength = kleor_password_strength(password);
if (strength > best_strength) { best_strength = strength; best_password = password; } }
return best_password; }
</script>
<?php }


function kleor_password_strength($password) {
$password = kleor_strip_accents($password);
$length = strlen($password); $strength = 0;
if ($length > 0) {
if ((strtolower($password) != $password) && (strtoupper($password) != $password)) { $strength += 1; }
foreach (array('/[0-9]/', '/[^a-zA-Z0-9 ]/') as $pattern) {
if (preg_replace($pattern, '', $password) != $password) { $strength += 1; } }
$characters = array(); for ($i = 0; $i < $length; $i++) { $characters[] = substr($password, $i, 1); }
$strength = $length*($strength + log(count(array_unique($characters)), 2)); }
return $strength; }


function kleor_password_strength_js() { ?>
<script>
function kleor_password_strength(password) {
var password = kleor_strip_accents(password);
var length = password.length; var strength = 0;
if (length > 0) {
if ((password.toLowerCase() != password) && (password.toUpperCase() != password)) { strength += 1; }
if (password.replace(/[0-9]/g, '') != password) { strength += 1; }
if (password.replace(/[^a-zA-Z0-9 ]/g, '') != password) { strength += 1; }
var characters = []; for (i = 0; i < length; i++) {
var character = password.substr(i, 1);
if (password.substr(0, i).indexOf(character) == -1) { characters.push(character); } }
strength = length*(strength + (Math.log(characters.length))/Math.LN2); }
return strength; }
</script>
<?php }

Of course, you can change the source code of these functions, but don't change their names.

36.3 Custom Autoresponders

You can add an autoresponder that is not natively integrated with Affiliation Manager. To do this, create a plugin with a cotillion like this (simple version):

function add_my_autoresponder($autoresponders) {
$autoresponders['My Autoresponder'] = array('function' => 'subscribe_to_my_autoresponder');
return $autoresponders; }

add_filter('affiliation_autoresponders', 'add_my_autoresponder');


function subscribe_to_my_autoresponder($list, $contact) {
…
…
}

or like this one (more elaborate version):

function add_my_autoresponder($autoresponders) {
$autoresponders['My Autoresponder'] = array(
'function' => 'subscribe_to_my_autoresponder',
'display_function' => 'display_my_autoresponder',
'update_function' => 'update_my_autoresponder');
return $autoresponders; }

add_filter('affiliation_autoresponders', 'add_my_autoresponder');


function subscribe_to_my_autoresponder($list, $contact) {
…
…
}


function display_my_autoresponder($options, $back_office_options) { ?>
<table class="form-table"><tbody>
<tr style="vertical-align: top;"><th scope="row" style="width: 20%;"><strong><label for="my_autoresponder_api_key"><?php _e('API key', 'affiliation-manager'); ?></label></strong></th>
<td><textarea style="padding: 0 0.25em; height: 1.75em; width: 50%;" name="my_autoresponder_api_key" id="my_autoresponder_api_key" rows="1" cols="50"><?php echo (isset($options['my_autoresponder_api_key']) ? $options['my_autoresponder_api_key'] : ''); ?></textarea> 
<span class="description" style="vertical-align: 25%;"><a target="<?php echo $back_office_options['documentations_links_target']; ?>" href="https://www.kleor.com/affiliation-manager/documentation/#my-autoresponder"><?php _e('More informations', 'affiliation-manager'); ?></a></span></td></tr>
<tr style="vertical-align: top;"><th scope="row" style="width: 20%;"></th>
<td><input type="submit" class="button-secondary" name="submit" value="<?php _e('Update', 'affiliation-manager'); ?>" /></td></tr>
</tbody></table>
<?php }


function update_my_autoresponder($options) {
if (isset($_POST['my_autoresponder_api_key'])) {
$_POST['my_autoresponder_api_key'] = trim($_POST['my_autoresponder_api_key']);
$options['my_autoresponder_api_key'] = $_POST['my_autoresponder_api_key']; }
return $options; }

The subscribe_to_my_autoresponder function subscribes the user in a list of the autoresponder. The display_my_autoresponder function displays the options of the autoresponder in the Autoresponders integration module of the Options page of Affiliation Manager. And the update_my_autoresponder function updates these options when submitting the form of this page.

To better understand how to do this, look at the source code of this plugin.

36.4 Custom Files

You can replace all Affiliation Manager files (except affiliation-manager.php) with your own files. For this, create the affiliation-manager-custom-files folder in the plugins directory (the one where you installed Affiliation Manager) of your website.

For example, if you want to replace the includes/data.php file of Affiliation Manager with a file you have customized, create the includes folder in the affiliation-manager-custom-files folder, and upload your data.php file to this folder.

You can set yourself the directory where your custom files are stored, by inserting this line:

define('AFFILIATION_MANAGER_CUSTOM_FILES_PATH', ABSPATH.'custom-files/affiliation-manager/');

just after:

if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

in your wp-config.php file.

Replace custom-files/affiliation-manager with what you want. The value of AFFILIATION_MANAGER_CUSTOM_FILES_PATH must end with a /.

36.5 Custom Languages

Affiliation Manager is developed in English and contains files that translate it in French. If you wish, you can translate it into another language.

To do this, create your custom files directory by following these guidelines. Create the languages folder inside of it, and upload your translation files to this folder.

You can create your translation files with the languages/affiliation-manager.pot file of the plugin, and by using the free software Poedit. Your MO and PO translation files must be named like this:

affiliation-manager-ll_CC.mo
affiliation-manager-ll_CC.po

ll_CC is the value displayed by this line of cotillion:

echo get_locale();

when it's executed in one of the files of your WordPress website.

37. FAQ

37.1 Can I use cotillions in fields of admin pages?

Yes. You can insert all the cotillions available on your website in most fields of Affiliation Manager admin pages. This allows an unlimited number of possibilities, including the automatic modification of the commission percentage according to the date or the affiliate's performances.

37.2 How can I schedule an automatic modification of the commission percentage according to the date?

To schedule an automatic modification of the commission percentage according to the date, install and activate the free plugin Easy Timer and insert into the Commission percentage field a cotillion like this:

[countdown date=2011/09/23]30[after]40[/countdown]

In this example, the commission percentage will automatically switch from 30 % to 40 %.

37.3 How can I schedule an automatic modification of the commission percentage according to the affiliate's performances?

To schedule an automatic modification of the commission percentage according to the affiliate's performances, insert into the Commission percentage field a cotillion like this:

[affiliate-counter data=amount limit=1000]40[after]50[/affiliate-counter]

In this example, the commission percentage will automatically switch from 40 % to 50 % when the total amount of orders and recurring payments referred by the affiliate has reached or exceeded 1000 dollars.

Refer to the Counters Of Affiliate's performances section to learn about all available options.

Example 2:

[affiliate-counter data=affiliates range=previous-year limit=1000]40[after]50[/affiliate-counter]

In this example, the commission percentage will automatically switch from 40 % to 50 % if the number of affiliates referred by the affiliate during the previous year is greater than or equal to 1000.

Example 3:

[affiliate-counter data=clicks range=previous-month limit=1000]40[after]50[/affiliate-counter]

In this example, the commission percentage will automatically switch from 40 % to 50 % if the number of clicks on the affiliate's links during the previous month is greater than or equal to 1000.

Example 4:

[affiliate-counter data=orders range=120 limit=1000]40[after]50[/affiliate-counter]

In this example, the commission percentage will automatically switch from 40 % to 50 % if the number of orders referred by the affiliate during the last 120 days is greater than or equal to 1000.

Example 5:

[affiliate-counter data=commission-amount limit=1000]40[after]50[/affiliate-counter]

In this example, the commission percentage will automatically switch from 40 % to 50 % when the total amount of commissions (level 1 and 2) on orders and recurring payments referred by the affiliate has reached or exceeded 1000 dollars.

37.4 How can I use cotillions in my WordPress theme?

Insert into the PHP files of your theme a cotillion like this:

<?php echo do_shortcode('[your-cotillion]'); ?>

37.5 How can I use cotillions in comments?

Edit the functions.php file (create it if it doesn't exist) of your WordPress theme and add this line of cotillion:

add_filter('comment_text', 'do_shortcode');

37.6 How can I use cotillions in attributes of cotillions?

You can use cotillions in most attributes of Affiliation Manager cotillions, provided to replace [ by ( and ] by ), like this:

[your-cotillion attribute='(your-other-cotillion)']

Don't forget to include the quotes at the beginning and the end of the cotillion.

37.7 How can I nest several identical cotillions?

When you nest several identical cotillions, you must add an integer between 1 and 3 at the end of the tags of these cotillions, like this:

[affiliation-counter…]…
[affiliation-counter1…]…
[affiliation-counter2…]…
[affiliation-counter3…]…
[/affiliation-counter3]…
[/affiliation-counter2]…
[/affiliation-counter1]…
[/affiliation-counter]

38. Changelog