Engaging your audience - do-it-yourself affiliate program

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

    We do a meta-search of air 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 airline ticket program .


    Why do I need an affiliate program for my service?


    This question is especially relevant on Habré; here the overwhelming majority of the audience are techies who are poorly versed in the intricacies of marketing and the emotional organization of customers.

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

    Thanks to active PP, you acquire an additional source of traffic, which not only leads targeted visitors, but also positively affects all aspects of the project’s life:
    • feedback from those who attract visitors;
    • feedback from visitors themselves (you might not have found some categories yourself);
    • the positive impact of various traffic sources on search engine ranking.


    What should be in the affiliate program?


    In the engine of any software there are four main modules:
    • user accounting system, cookie assignment and separation of sources;
    • billing - everything related to money (or other bonuses to users);
    • collection and presentation of statistics;
    • promotional materials for partners to effectively promote your product.

    We will analyze each system separately.

    User accounting

    The task of this subsystem is to accurately separate users, understand the sources of traffic, attribute each transition to a specific partner and ensure that cookies do not go out.

    User accounting should work as high as possible in the system. Before the business logic of your application starts, you should already know exactly what kind of user this is - he came from a search engine or from a partner site.

    buruki.ru are made on Django , therefore we use separate middleware which is responsible for processing of any incoming request. Middleware checks if the user has already been on our site, whether he came via a 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:
    • user_id - unique id;
    • created - user creation time (+ setting cookies, minimum decay for software - 15 days, usually 30);
    • referer_url - Referral source (we save the full URL of the first and last access to the site);
    • referer_id - affiliate account from which the user switched (determined by the ref-parameters of the link). You can immediately start fake referers to consider the effectiveness of your own traffic sources (contextual advertising, contests, articles on Habré :-));
    • label - an arbitrary line that your partners will set in the link to share their traffic sources themselves and see the effectiveness of different approaches in statistics (for example, this way you can find out what works best - a banner in the blog header or in the sidebar);
    • ua_string - user-agent of the user - will be useful in statistics;
    • user_ip - if possible - IP (should be stated in the privacy policy).

    When you implement a similar middleware for your project, you will surely come across a question - if the same user came from different referers, to whom should this user be assigned? The answer to this question depends on the specifics of the project. We chose the answer for ourselves - "who is the last, that is the pope." The referer who last brought the user to the purchase receives the 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 filled a couple of large cones. The first desire was to not read anything and quickly weaken. It didn’t work out. We used direct operations with users' wallets and, despite the pieces of double-entry, all this was growing more and more crutches. In the end, it became impossible to use it, and it became scary to add something new. The capabilities of analytics and accounting were also very limited.

    In this matter, it is not worth reinventing the wheel. You need to use accounts, sub-accounts, double entry, transactions and red reversal . In general, everything that was invented by accountants before us. We used a ready-made solution from our other project. You are advised to 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 the affiliate program works. Partners need statistics to bring you the most effective traffic, experiment with sources, and try different strategies.

    Statistics should give you and your partners an exact answer to the main question - how much does it cost (or how much income) each referred visitor who has committed the target action.

    Depending on the specifics of your project, targeted actions may be as follows:
    • registration (the simplest);
    • sale or deferred sale (when an order is transformed into a sale after a certain period of time; an extreme case is cash on delivery via Russian Post. Russian Post is always extreme);
    • achieving some goal on the site. (for example, the level of hero’s leveling in an online game, purchasing a premium account, sending a profile).

    Statistics should provide a large amount of information, maximally covering the conversion funnel.

    In our case, we show the partner all the information about users:
    • The number of users involved;
    • Number of airline ticket searches;
    • The number of transitions to the reservation;
    • SPV - number of searches per visitor;
    • CPV - the number of transitions to booking a visitor;
    • CPS - the number of transitions to the reservation for one search;
    • Number of bookings made and paid (total and percentage);
    • Probably the most important thing is earnings per visitor, one search, one go to booking (EPV, EPS, EPR).

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

    For further analysis, it is useful to enable statistics uploading to CSV.

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

    Promotional materials

    Promotional materials - this is what partners will attract users to you.

    Usually, the partners that come to your PP already have traffic sources, they have their own resources where your potential users live. The point is small - give your partner promotional materials that he can easily insert on his site.

    The main types of promos, most of which we have already implemented:
    • links and deeplinks (links to specific products, landing pages, sections). The easiest tool, suitable for most tasks. If you have long links - do not forget to give the opportunity to use a shortcut;
    • banners - regular and flash. The main formats are 240x400, 460x60, 200x200;
    • widgets - interactive blocks with your suggestions, the results of the service. Fast delivery of the most valuable offers;
    • whitelabel - the ability to install all or part of the functionality of your site on an external site. For example, we specialize in airline tickets, and we take the hotel component from HotelsCombined - hotels.buruki.ru . By the way, HotelsCombined is perhaps the best metasearch engine for hotels - made by our former compatriot;
    • from new - to attract traffic from the social. Networks are useful to have collection generators. Something that may interest users. We have a selection of low prices for various flights;
    • API - for cool peppers. Maximum access to the functionality of your service.

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

    Total


    Affiliate program is an understandable tool that is suitable for 99% of projects. Do what you know how to do well, make an excellent product, and those who are closer will engage in attracting an audience.

    Also popular now: