Overview: I would like to write a new-generation affiliate module for Drupal, with integration for Drupal Commerce.
Who am I: The creator and one of the maintainers of the Ubercart Affiliate 2 module.
It is the only active ubercart affiliate module, used in about 490 sites and growing.
Also a zend certified engineer and maintainer of several other drupal modules.
The Background:
The current Ubercart Affiliate module has the following features:
- User and role based tracking.
- Multiple commission levels, also available per role and per product.
- Fixed-rate and percentage commissions.
- Ability to add cookies so that affiliates get credit for return visits even though they didn't go through original affiliate link.
- Token and Conditional Actions integration.
- The ability for the admin to see all commissions on an order, and add/delete commissions manually.
- The ability for the admin to see monthly sale&commission reports, and note down how much the affiliate has been paid.
- Affiliate dashboard providing statistics (sales/commissions reports), affiliate link generating (image and text product links)
It's used in a decent number of sites, tested and used with both mysql and postgresql.
However, it has no documentation, no unit-tests, and a limited user interface that doesn't really win any awards (it has
been assembled piece by piece, not designed).
This is the only active ubercart affiliate module.
Viewing drupal in general, there's an affiliate module, but it has few features, and has been abandoned (last activity in december 2008).
I would like to use the resources that Google Summer Of Code would give me, and write a new Drupal Affiliate module,
using the wisdom of previous implementations and the power that Drupal 7 (+views, rules) gives us.
The idea:
Three submodules:
1) affiliate.module
This is the core module.
A website affiliate system at its most basic level simply tracks a user with an affiliate code
If you come through a link, put in a code, etc., that affiliate code becomes associated with your account.
This association is either temporary (session or cookie based) or permanent (a field on your user account)
This module handles all the link types (?a=, /affiliate/uid/redirect/to, etc), all the association types (session, cookie
based, permanent via user account), the basic data module and api to be used by the other parts.
By integrating with Rules it allows submodules to do different things on key events.
These events could be:
a) The registration of a user associated with an affiliate
b) A "click" (a user arrived to the site via an affiliat elink)
c) An order checkout (in the case of the drupal commerce adapter)
d) Role escalation (after a certain number of sales/clicks/points/whatever)
And upon each event the submodules can do things such as:
a) Award user points
b) Award the affiliate a fixed or percentage commission (drupal commerce adapter)
2) affiliate_ui.module
This module provides the basic user interface:
a) The basic settings
b) The basic reporting (clicks, user signups sorted by affiliate, date, etc. Monthly statistics)
This module integrates with views.
3) affiliate_commerce.module
This module integrates with Drupal Commerce.
a) Allow the admin to define fixed or percentage based commissions to roles, products, or individual users.
b) After checkout, give a commission. Provide a rule to send an email if a commission was added.
c) Option to manually add, or delete a commission.
d) Basic statistics (sales & commissions, monthly, by order)
This is the basic idea. After GSoC I would like to provide PayPal Mass Payment API integration and multi-level affiliating (upline/downline).
Timeline:
May 24 - 31st - Setup the dev environment (drupal project, github project), get familiar with the Rules and Views API
June 1 - 16 - Code the first module (affiliate.module)
June 16 - July 12 - Code the second module (affiliate_ui.module)
July 12 - submit midterm
July 16 - August 2 - Code the third module (affiliate_commerce.module)
August 3 - August 16 - Additional work where needed. Focus on user and developer documentation.
August 17 - August 20 - polish up and submit final report
Possible Mentors:
Ryan Szrama (a big help and huge influence regarding this proposal. Thanks, Ryan!)
Requirements: Drupal 7, Views, Rules, Drupal Commerce (for the Drupal Commerce adapter)
Possibly Advanced help, for documentation.
Contact Details:
bojanz@gmail.com (email and msn), bojan.zivanovic (skype)
Difficulty:
Medium
N/A
3 Months (Google Summer of Code)
I will implement the project. It will be distributed through drupal.org
Funded by Google Summer of Code

Comments
Good Idea
I've never used the uc_affiliate module before, can you please tell us a bit about where the module is right now and where you'd like to see it after the SoC? I think there's a very good chance that Drupal Commerce will be ready in time for GSoC, but you may want to propose it in a way that doesn't limit you to that module's availability. Besides simply porting it, you say there are other features you'd want for the module (or a new architecture?), so I'd focus primarily on those items, with the intention of building it for D7 Drupal commerce, but with the option to build it for ubercart if it isn't ready.
Also- please ignore the Knight Initiative stuff- I have to figure out a way to turn that off, it's not really meant to be used for our proposals (though it doesn't harm them it does make it very confusing.
Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology
further affiliate development is a GREAT project
Hi bojanz - thanks for the good work on the affiliate module - I hope this one makes it through also. Good luck.
Dev and Support: prometsource.com
Hi, I'm finishing a project
Hi,
I'm finishing a project and preparing some exams, so my online presence is suffering a bit.
The current module is "good-enough" for most use cases.
It has:
User and role based tracking.
Multiple commission levels, also available per role and per product.
Fixed-rate and percentage commissions.
Ability to add cookies so that affiliates get credit for return visits even though they didn't go through original affiliate link.
Token and Conditional Actions integration.
The ability for the admin to see all commissions on an order, and add/delete commissions manually.
The ability for the admin to see monthly sale&commission reports, and note down how much the affiliate has been paid.
Affiliate dashboard providing statistics (sales/commissions reports), affiliate link generating (image and text product links)
It's used in a decent number of sites, tested and used with both mysql and postgresql.
The code has recently been cleaned up.
This is why I would like to propose the new Affiliate module for Drupal Commerce only, the existing Ubercart implementation is nice enough and can be improved along the way (and ported to Ubercart for Drupal 7).
I've recently found a co-maintainer and users provide a steady influx of patches.
The new module should be a step beyond that.
The current module is a product of my limited free time, and others enthusiasm and patches.
This means no documentation, no unit-tests, and a limited user interface that doesn't really win any awards (it has been assembled piece by piece, not designed).
The current module has the features and the code, the new one should have a much improved interface.
The interface needs to better handle more complex use cases that have surfaced, while still handling the simple use cases nicely.
Right now the payment support is almost non-existant (a basic improvement proposal is here: http://drupal.org/node/715456, and I'm willing to consider some form of PayPal integration), the views integration is non-existent, the statistics screen is basic.
Tracking a large number of affiliates (divided into groups) is hard.
Those are my first thoughts, I will have a more defined improvement plan in the next few days.
Thanks, akucharski. Even if
Thanks, akucharski.
Even if the proposal doesn't make it, having a detailed plan for the module will come in handy for future improvements.
The 2.5 version for Drupal is a giant step forward over the previous stable version (although almost everyone is using either the 2.5rc1 or the dev version by now), I will release it as soon as the last few patches in the queue are examined and commited.
I'd be happy to mentor on
I'd be happy to mentor on this one. It's little known, but I actually developed a custom affiliate system for a client on Ubercart 2.x as well, so I'm quite familiar with the needs and difficulties. We actually implemented multi-level affiliates and checkout white-labeling through the system as well, though I'd see those as far from "required" features.
I think Drupal Commerce will be far enough along for affiliates to make sense, mostly because an affiliate module doesn't need to concern itself overly much with the e-commerce integration. It's mostly a separate system with a little bit of tie-in through the checkout form. Beyond that, you're simply doing lead tracking, user relationships, transaction logging, affiliate reports, etc.
Targeting Drupal Commerce, we're already depending on Views and Rules 2 instead of Conditional Actions, and of course core has Token support now (a huge win, imo). I think a sufficient proposal can examine the basic affiliate requirements, translate those into these existing components, rough out the data model and displays, and then propose points of integration with the Commerce modules themselves. I bet you could end up with an affiliate module that is flexible enough to be used for managing referral bonuses based on Commerce transactions or even more simply as awarding User Points or establishing User Relations through affiliate sign-ups (i.e. on sites that aren't running Commerce). Obviously, targeting Commerce will bring you the quickest pool of users, testers, and contributors, so I think it's an essential part of the module's development.
I think 3 months is highly realistic, and I'm happy to be available as much as possible. Drupal Commerce is being developed on d.o, although we are using GitHub as our base repository and pushing commits from there to CVS on d.o. I don't think that goes against the spirit of webchick's post. Whatever comes of this project can easily be managed entirely through d.o, and I highly recommend seeing if you can take over http://drupal.org/project/affiliate for this development. (Last commit was December 2008.)
I've updated the
I've updated the proposal.
It's still a work in progress, but it's a lot more fleshed out...
Lookin' good. : )
Lookin' good. : )
Affiliate Contact Form
We have setup the Ubercart Affiliate Module. Very useful for us.
However we can't figure how to make an affiliate contact form for anonymous users. The standard site contact form only sends email to the site owner.
Do you have any suggestions? Do we need to modify modules?
Thanks
Please use the issue queue of
Please use the issue queue of the Ubercart Affiliate module for seeking help (I'd be glad to help), no need for us to spam this thread.
The affiliate module doesn't provide any contact forms, so you will need an additional module to do that.
My proposal has been
My proposal has been accepted. Ready to rock :)