📜 ⬆️ ⬇️

Attracting audiences - do-it-yourself affiliate program

image
Hi, Habr! This article is the first in our blog.

We make a meta-search for airline tickets buruki.ru with a human face. Here we will share the technical and psychological discoveries that we make every day in the work on the project.

Today, about how you can quickly launch an affiliate program (PP) for your service in a week. As an example, we use our recently launched affiliate program for airline tickets.
')

Why do I need an affiliate program for my service?


This question is particularly relevant on Habré, here the vast majority of the audience are techies, poorly versed in the intricacies of marketing and the mental organization of customers.

In a cool startup, it’s not always possible to take a marketer, advertiser, PR manager, etc. from the first day. But to run your affiliate program and give the question of attracting an audience of professionals or the users themselves is easy. This is exactly what the guys from Dropbox did - for each friend you brought, you received 500 MB of additional quota and this worked on an affiliate program, the principles of which are described below.

Thanks to active software, you get an additional source of traffic, which not only leads targeted visitors, but also has a positive effect on all aspects of the project’s life:


What should be in the affiliate program?


In the engine of any PP there are four main modules:

Let's sort each system separately.

User account

The task of this subsystem is to precisely separate users, understand the sources of traffic, refer each transition to a specific partner and ensure that cookies are not rotten.

User accounting should work to the maximum “high” in the system. Before the business logic of your application starts, you should already know exactly what kind of user it is - it came from a search engine or from a partner site.

buruki.ru are made on Django , so we use a separate middleware, which is responsible for processing any incoming request. Middleware checks if the user already has a user on our site, if he has come through the referral link, if the link has additional parameters, etc.

Determine who brought the visitor this time.
ref = request.GET.get('ref') if not ref: #  ref ,      #     . http_referer = request.META.get( 'HTTP_REFERER', 'http://direct.com' ).replace('http://www.', 'http://') ref_host = urlparse(http_referer).hostname referer = get_object_or_None(Referer, ref_code=ref_host) if referer is None: if not ref_host: #  ref_host ,    #  ref- “direct.com”,     . ref_host = 'direct.com' else: #  ref_host ,    . #    . Referer.objects.create( name=ref_host, ref_code=ref_host, activated=True, cookie_lifetime=30 ) ref = ref_host #      ref-, #        GET-, #   HTTP_REFERER,   “direct.com”. try: #     ,    . referer = Referer.objects.get(ref_code=ref, activated=True) except Referer.DoesNotExist: #     ,      #  middleware. log.warning('Referrer is not found: ref_code=%s' % ref) return 


The minimum set of information that must be stored about each user:

When you will be implementing similar middleware for your project, you will surely come across a question - if the same user came from different referer's - who would you take this user to? The answer to this question depends on the specifics of the project. We chose the answer for ourselves - “who is the last, is the same as dad”. Referer, who last brought the user to the purchase, he receives a reward.
Determine what to do with the visitor
 visitor = get_object_or_None(Visitor, pk=visitor_id) #    , ... create_visitor = ( # ... visitor_id  ,     . #  . visitor is None # ...    , #     ,    — . #   — , ,   . or (visitor.referer != referer and (referer.real or not visitor.referer.activated)) # ...  . or (visitor.referer_expire and visitor.referer_expire < datetime.now()) ) #  not create_visitor,    . 


Billing

With billing, we stuffed a couple of big bumps. The first desire was to read nothing and to relax quickly. Did not work. We used direct operations with users' wallets and, despite the pieces of double-entry, all this became crutches more and more. In the end, it became impossible to use it, and it became frightening to add something new. The possibilities of analytics and accounting were also severely limited.

In this matter, reinvent the wheel is not worth it. You need to use accounts, subaccounts, double entry, transactions and red cancellation . In general, everything that was invented by accountants before us. We used a ready-made solution from our other project. We recommend that you look at ready-made solutions, for example, django-oscar-accounts .

Collection and provision of statistics

Statistics - is a king. You need statistics to understand how your project works, how an affiliate program works. Statistics are necessary for partners to bring you the most efficient traffic, experiment with sources, try different strategies.

Statistics should give you and partners an accurate answer to the main question - how much does it cost (or how much revenue does it bring) for each given visitor who performed the target action.

Depending on the specifics of your project, the target actions may be as follows:

Statistics should provide a large amount of information, covering the conversion funnel as much as possible.

In our case, we show the partner all the information about users:

There are really a lot of numbers, naturally, many of them are mathematically related. But we were convinced from our experience that it is necessary to show all possible values. Not rarely, changes on the site affect several parameters and the statistics immediately gives a complete picture.

For further analysis, it is useful to give the ability to upload statistics to CSV.

Once again - statistics, this is very, very important. Both for you and for partners.

Promotional materials

Promo materials - this is what partners will entice users to you.

Usually, partners who come to your PP already have sources of traffic, they have their own resources where your potential users live. Things are a little less - to give your partner promotional materials that he can easily put in his place.

The main types of promo, most of which we have already implemented:

It is important not to forget that URLs from which you give widgets or frames to third-party sites should not be counted in the statistics. Otherwise, all visitors to the external site may be mistakenly credited as attracted users.

Total


An affiliate program is a clear tool that is suitable for 99% of projects. Do what you know well, make an excellent product, and attracting the audience will be engaged in those to whom it is closer.

Source: https://habr.com/ru/post/188218/


All Articles