Affiliate program setup tutorial with Ubercart in Drupal
This document will discuss the setup of an affiliate program, like the one at book.drupalfun.com. Feel free to take a test-run through the affiliate sign up process at http://book.drupalfun.com/affiliate. I will be describing how I made this particular setup.
(in FF: right click on image -> view image to see larger image)
1. Enable the necessary modules
In order to set up an affiliate program, we need to enable the following modules at /admin/build/modules:
- Ubercart (should go without say)
- Apply for Role
- Role Change Notify
The screenshots are taken on a Drupal 5 site, but the differences with Drupal 6 are minimal, so D6 users can just as well use this tutorial.
2. Configure Affiliate2
The first thing to configure, is the affiliate2 module at /admin/store/affiliate/settings
This page is documented pretty good and allows you to specify your affiliate depth and commission structure. An important option to look at is the â€œsubdomain handlingâ€ checkbox. Generally, it's a good idea to leave this unchecked, unless you know what you are doing.
4. Collecting affiliate information
You most probably want to collect some information about your affiliates, like their PayPal address (you do want to pay them right?) and their website. We can add these fields at /admin/user/profile
Now, your users will be able to fill in this affiliate information under their account.
3. Letting your users apply to be an affiliate
The Affiliate2 module uses â€œrolesâ€ to specify whether a user is an affiliate or not. So the first thing for us to do is to create a new role called â€œaffiliateâ€ at /admin/user/roles. Give this role the permission to â€œact as an affiliateâ€ at (user management â†’ access control or permissions).
The next step is to let your users apply for the affiliate role. This way you have total control over who does and does not fill your requirements (If you want to skip this and automatically approve affiliate applications, use the Role Signup module).
Let's configure the Apply for Role module at /admin/settings/apply_for_role, to allow single role applications for the affiliate role. Whenever a user applies for a role, you can check this at /admin/user/apply_for_role and we'll configure the system so that it sends you an email notification (in the next section).
5.Setting up some important notifications
Although the system is operational at this time. It's important to set up some system messages, as to keep your users informed about their registration progress.
a. Registration welcome email
If you did not enable the â€œapply at registrationâ€ option above, you need to inform your users that if they want to become an affiliate, they still need to click the â€œapply for roleâ€ button after logging in. You can do this in the default welcome email at /admin/user/settings.
b. Screen message thanking for role application
Create a â€œdisplay a message to userâ€ action at /admin/settings/actions.
Set up a trigger at /admin/build/trigger/apply_for_role. Select the action you have just created for the trigger: â€œWhen a user submits an application for a roleâ€. This will display a message on the screen, informing the user about his pending application.
c. Email admin about the application
Unless you plan on logging in constantly, and checking the affiliate applications manually at /admin/user/apply_for_role, you probably want to be emailed whenever a user applies for the affiliate program. This is done in a similar fashion as the above message:
- Create a â€œsend e-mailâ€ action at /admin/settings/actions.
Set up a trigger at /admin/build/trigger/apply_for_role. Select the action you have just created for the trigger: â€œWhen a user submits an application for a roleâ€. This will send an email to the admin about the new affiliate application.
d. Email the user about the approval
Lastly, we need to inform the user that his affiliate-ship has been approved. We'll send an email with this information, plus some details on where they can find their personal links etc.
We need the Role Change Notify module for this. After enabling the module, go to /admin/user/role_change_notify, and set up the email for the role â€œaffiliateâ€.
6. Informing users about the program
Your affiliate program is up and running smoothly. The one thing left to do, is to write a small document (create a page) informing your users about the program and how to apply:
7. Bonus: Contacting all your affiliates
In order to send an email to all your affiliates, you can use the Mass Contact module to contact all of the users that have the â€œaffiliateâ€ role. Set up a category for this at /admin/build/mass_contact/