Ads integration: how does it work?

FunCorp
7 min readDec 18, 2020

--

Advertising is one of the most popular ways to monetize entertainment projects and applications. By the example of iFunny, we’ll go further into the mechanisms of getting ads and some of the difficulties you may encounter while integrating an advertising software development kit (SDK).

Example of a digital ad on iFunny

Glossary and general mechanics

Inventory is the set of all the advertising placements of the site, application, etc.

In the iFunny inventory, there are two types of placement. A banner is placed below the content and is almost always on the screen. In comparison, a native ad is inserted in the feed instead of the content at specific intervals.

Example of a native vs. banner ad

A publisher is a platform, which inventory is used to place advertisements.

A publisher can work directly with an advertising network (AN), but it doesn’t have to be only this way. In the advertising model used by iFunny, there is a third participant — a mediator. That means that they try to show ads that bring the highest revenue in the app. The app does not work with just one AN but with several at once. In the mediator’s system, for each inventory object, there is a unique id, which is used by the publisher to request ads. In response, the mediator offers options for the settings, based on which the mediator will contact one of the AN to get the most expensive ads.

The mediator and all the advertising networks iFunny works with are external contractors; we do not have our own AN.

There exist two fundamentally different work models to acquire ads: a waterfall and an auction. Let’s take a closer look at them.

The waterfall model involves going through the order’s settings based on historical data on CPM (cost-per-mille, i.e., price per 1000 impressions) until the ads are uploaded. The application requests the mediator’s neighborhoods and, having received them, goes to a particular AN. In case of a positive response, there is an attempt to upload the proposed creative (with all accompanying resources). At the end of the iteration, a message with results is sent to the mediator. However, the whole process is repeated in the event of a failure at any of the stages. As a result, hundreds or even thousands of requests can be made to upload a single banner. This mechanism affects the loading time of the banner. Indeed, all this also depends on the length of the waterfall.

In the auction model, the problem with time and number of requests is solved: the app queries each network about the maximum price the network is ready to buy inventory right now. Then the mediator chooses the most profitable option for the publisher and returns the settings to try to get ads. There is an “almost certainly” chance that the AN will give us the ads with these settings (because it had already promised them a couple of steps earlier).

How the process of getting ads in iFunny is built

iFunny is continuously experimenting with approaches and mainly uses a mixed version:

  1. First, the networks we work with by the auction model are queried.
  2. We wait for a response from all the partners.
  3. The received bids are saved on the client-side and sent to the mediator’s SDK.
  4. The mediator, having received the bids, adds them to the existing waterfall.
  5. The mediator descends the waterfall from top to bottom and offers the application a settings option to request AN.
  6. The control of uploading is passed to the partner’s SDK, which processes the settings sent by the mediator.
  7. With received settings, the application contacts the partner in an attempt to get ads.
  8. The partner returns the app’s settings to upload the creative (just in case you are lucky enough).
  9. The application attempts to upload the creative.
  10. Creative with all its resources are uploaded to the device (if you are doubly fortunate).
  11. The app renders ads.

Under the best-case scenario, you can do with one iteration: the choice will be between the highest bid and the first level of the waterfall. In the worst case, you’ll have to try again and again, gradually descending the waterfall.

SDK

Many AN Strive to make their ads unique and recognizable. If you want to collaborate with a particular AN, you will most likely have to implement their SDK into your codebase to show their ads. In addition to the unique design, SDK usually implements their logic for sending analytics events.

Targeting

In the mediator’s ad networks’ accounts, you can specify interesting categories to your product’s target audience: sports, travel, books, education, entertainment, games, etc.

For example, some AN does not hesitate to request the operating system and use information about the device’s position in space. This way, they understand, among other things, whether to show a creative in the portrait or landscape orientation of the device.

Analytics

Analytics is essential when it comes to counting money — who owes whom and how much.

Every advertiser wants to know all the statistics on his creatives precisely. Which publisher and how many times has it shown? And how many clicks were there? And if the creative contains video, there can be a million events: they showed on the screen the adapter with the creative — an event; playback started — another event; the user turned on or off the sound — another event; watched 25% of the video length — can also be recorded.

iFunny has its analytics system, and now five different events are logged:

★ Ad Requested — Statistics on each advertising request:

  • Type of advertising (native or banner)
  • AN
  • Upload success (if unsuccessful, why)

Ad Attempt — Shows the time from the very first ad request until it is successfully received. This way, you can experiment with the waterfall and its length, predicting the time necessary to get ads.

★ Ad Viewed — If creativity has been shown, it is necessary to remember the information about it — it will help define payments from the advertising networks.

★ Ad Tapped — Similar to the previous one, but if the link in the creative was clicked.

★ Ad Revenue — As a rule, the mediator sends its CPM along with the settings for the ad request. This information allows you to record the revenues expected from impressions and provides vast opportunities for analysis. iFunny makes active use of this.

All data about successful impressions and clicks are collected directly by the mediator. Thus, you can rely on the information stored by the mediator in case of disputes.

Problems

Advertising integrations bring not only money but also how it copes with problems. For a single attempt to get an ad, it takes 11 steps, and at each, something can go wrong. Testing is usually done on one of the same devices, and advertisers may consider such devices as a tool for impression fraud. Hence, there are problems with getting ads during the testing phase. Not all AN have test mode functionality, which solves this problem. Some have a test mode, but it is precarious. Moreover, if some functionality works in test mode, it doesn’t mean that it will work the same way with real creativity.

Often when it comes to sending analytics, problems can be found. For example, it may turn out that if the ad is video content, AN will count the ad’s impression only if the user has watched the first 5 seconds of the video.

After all, you need to understand that any third-party SDK in the code base is a black (or not so black) box that does useful work and generates problems. The quality of the code written inside the SDK is the third-party developer’s responsibility, not yours. Sometimes this quality can be managed, but usually, the code is obfuscated, and you can only guess what a.b.c.d.e.f. is responsible for and what k.l.m.n.p. means.

From time to time, new versions of the SDK are released. Often the task of “updating SDK X” involves reconnecting from the beginning. Or vice versa, you need to update one file but suddenly find out that almost everything doesn’t work. This is usually followed by several hours of research. All these problems are usually caused by the fact that the updated version’s changelog does not reflect the actual changes, and sometimes it simply does not exist. But this is understandable: publicly acknowledging problems, even if they have already been solved, can cost advertisers a lot of money.

For sure, advertising is a powerful tool in product monetization. It can be used in different ways: some only need to have one banner in their inventory, which is filled with just one AN, while others build massive systems that combine several mechanics and dozens of AN at once. When choosing a model of interaction with AN, it is worth considering the complexity of the further support of this system. Choose the solution that will be effective precisely in your case.

--

--

FunCorp

Since 2004, we’ve been doing our part in changing the entertainment & tech space. Learn more at http://bit.ly/3XWJemV