How we reused platform analytics to make work easier

Analytics Platform in Avito. In this article, I will tell you how we wrote the Marketing Manager (MM) service for placing data in advertising systems. You will learn what our manager can do, how it is structured, and how this solution saves marketing analysts time.

At Avito, we attract liquidity from external advertising platforms and optimize this process through Return On Investment (ROI). To do this, we transmit target events to advertising systems, such as contacts by items (an item is an ad, a product, etc.). And they, in turn, use this data within the framework of a real-time auction for the user.

To solve this problem, we have developed a service called Marketing Manager. It will allow sending data based on analytical events occurring on the Avito platform directly to advertising systems, without 3rd party marketing code inside the front and with the ability to enrich the data with analytical models.

Problems with the current approach with 3rd party SDK

All the existing problems of the approach we want to move away from can be grouped into three groups:

Data consistency:

  • the source of events is often some microservice, not a front;

  • we optimize for proxy metrics, not target metrics, that is, we can trigger sending only based on actions occurring on the UI;

  • we do not take into account anti-bot mechanisms.

Resources and difficulties:

  • support for third-party libraries on the front ends and refinement of events after each product release;

  • lack of development resources in marketing. The problem is that product teams are sawing features, covering them with clickstream events, and then it's a gray area. Either marketing finds out after the fact and requires additional development resources, or we just take the existing clickstream events and use MM to forward them to the required advertising system;

  • high TTM, release cycle with 100% rollout on iOS/Android — from 2 months.

Clarification on the second point, about the lack of a resource. There are two problems here:

  • a marketing analyst needs to know that a new feature has appeared;

  • A marketing analyst needs to find resources to add 3rd party code for his marketing campaign.

Teams cover features with clickstream by default, and marketing analysts can use MM to reuse data and feed it into the advertising system.

Risks:

  • Disabling external tools due to sanctions. Our platform allows you to switch the event flow to an alternative tool as quickly as possible;

  • risks of competitive espionage;

  • degradation of performance indicators and the presence of a 3rd party SDK “zoo” affects page loading time, increases TTI, and generates additional network requests.

Marketing Manager — is a platform that allows you to configure, filter, enrich and send messages based on clickstream events to external advertising systems (hereinafter referred to as accounts) in a mode close to real time. Sending can involve event fields that are marked as non-personal data. We previously talked about clickstream events and more in a post dedicated to analytical event logging platform.

High-level architecture

High-level architecture

Work scheme

Events from sending sources (services, frontends, mobile applications) are collected via clickstream, then they pass the flink job of the main enrichments and the job of enrichments for the Marketing Manager service. After that, they are laid out by topics, each account has a separate topic. When reading events from a topic, a message is created for the account based on the event and the transformation rules for it. Then the message is sent to the account.

Warranties and limitations

Delivery guarantees — at least once. We survive a 2-day crash without losses, due to the kafka retantion settings. In case of problems in the receiving cabinets or the enriching pipeline, we will try to send the event infinitely. This allows us to survive a significant period of instability of the cabinets, but imposes some restrictions:

  • events are duplicated;

  • if there are problems in the account, we will not miss events, as a result, the event may “fly” to the account with a delay. If the event is not sent in 2 days, it will be lost. This is achieved by configuring the backoff strategy for sending requests to an external system.

Anti-bot cleaning guarantees — the platform has a standard stream anti-bot cleaning. The stream anti-bot is a flink job that includes dozens of heuristics calculated in real time. The clickstream-processing team is developing this flink job, and you might read more about this product in their articles.

Tool capabilities

  • export of specific events collected via clickstream to dashboards, without the need for multiple SDK calls. We use it only to generate the client ID;

  • configuration of exported messages based on event data;

  • filtering exported data at two levels (account and message). Filtering at the account level can be useful if you do not need events from all platforms (desktop_site, mobile_site, iOS, Android). Filtering at the message level may be required if you have specific data in the event that requires additional filtering logic;

  • Manage sending activity via the admin panel;

  • monitoring the flow of sent data;

  • support for various advertising systems and the ability to quickly transfer a shipment if necessary.

Example of export to VK Ads

As part of the transition from 3rd party SDK to S2S events, the marketing team needed to set up the export of data that is logged in clickstream events on the desktop and mobile versions of the Avito website.

The first thing we did was create a filter for the entire account (screenshot below), which looks at all incoming events and checks that the value of the business_platform system field is equal to one of the values: desktop_site or mobile_site.

Cabinet level filter

Cabinet level filter

The second step is to start configuring exported messages based on the cabinet scheme. The scheme is essentially the body of the request sent to the cabinet. The scheme in the system is created by developers who implement support for the new cabinet.

As a result, we managed to create n-th number of messages based on clickstream events for export to VK Ads.

Table of exported messages with basic information

Table of exported messages with basic information

The configuration of the exported message can be divided into the following blocks (despite the fact that this occurs within the same page):

1) Enter a name, select an event and select a scheme:

New message creation form

New message creation form

2) after selecting the scheme, its fields will be displayed below, which need to be filled in by selecting and configuring one of the proposed actions (three screenshots below). From the interface point of view, an action is a widget that allows you to define the logic by which the value of the scheme field will be set based on the event data (fields). From the backend point of view, this is the code that manipulates these events and writes them to the scheme field that needs to be sent.

List of schema fields for which actions need to be configured

List of schema fields for which actions need to be configured

Example of selected action for field 'u'

Example of selected action for field 'u'

Example of a selected and configured action for the 'u' field

Example of a selected and configured action for the 'u' field

3) after filling in the fields, the page will become available for saving, and the wrench icons next to it will turn blue.

Fully filled diagram

Fully filled diagram

4) to save and start sending, you need to check the activity box and click the “Save” button.

Conclusions and plans

The emergence of MM helped marketing analysts test a number of hypotheses related to the transition from SDK to S2S (server to server) and draw the following conclusions:

  • S2S events are a working alternative to SDK events, they do not degrade the key metrics of the marketing team;

  • strategies based on dynamic value (weighted buyer) did not show the expected results, and a decision was made to stop using such strategies in our campaigns.

In addition to the conclusions obtained on the basis of the tested hypotheses, it was possible to solve a number of problems. And the introduction of MM also allowed:

  • eliminate unnecessary code on the front ends;

  • reduce the TTM for export setup from two months (release cycle on iOS/Android) to several days;

  • ensure the guarantee of bot cleaning of the stream due to online anti-bot.

Our plans include supporting the transition from 3rd party SDK to S2S for all events for which this is possible. During the support, we expect minor improvements, bugs may be found, and feature requests will appear in the process.

Thank you for your time! If you have any questions or want to share your experience of developing and using managers similar to our MM – Welcome to the comments.

And also subscribe to AvitoTech channel in Telegramwhere we talk more about the professional experience of our engineers, projects and work at Avito, and also announce meetups and articles.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *