Advertisement in android apps

Android In-app purchasing: платное отключение рекламы в своём приложении

Много раз уже просили написать статью о том, как в приложении реализовать платное отключение рекламы. По In-app уже были статьи на хабре. Правда, они старую версию API рассматривали. В принципе, новая версия не особо то и отличается от старой. Была похожая статья, но там больше именно про отображение рекламы рассказывалось, а второй части статьи мы так и не увидели. Как оказалось, многим до сих пор интересен этот вопрос, решил написать как это реализовать в своём приложении.

In-App Purchase представляет собой сервис покупки виртуальных товаров внутри приложения (например игровой валюты, новых уровней и т.д.). Применяется он в основном в играх, в тех случаях, когда встает вопрос о необходимости заработка на своем творении.

В данной статье рассмотрю как можно использовать In-App Purchase для отключения рекламы в своём приложении.

Реклама в приложении

В принципе, можно взять любую площадку. Возьмём, к примеру AdMob. Я для удобства обычно подобные вещи в обёртки запихиваю, чтобы при смене площадки, если потребуется, почти ничего не пришлось менять. Обёртки для рекламной площадки должны реализовывать интерфейс:

Тогда обёртка для AdMob будет выглядеть примерно так:

Тогда инициализация рекламы будет такой:

При такой реализации в случае смены площадки, мы просто создадим инстанс другого класса. Для работы вам нужен лишь ID_приложения. который получите после создания в приложения в админке Admob.

In-app purchasing или внутренние платежи в приложениях

Для того, чтобы работать с системой покупок необходим файл IMarketBillingService.aidl. Лежит он в /user/android-sdk-linux/extras/google/play_billing директории с SDK. Положить файлик надо в com.android.vending.billing пакет вашего приложения.

О типах покупок можно почитать тут. Нас интересую восстанавливаемые покупки, то есть те, что привязываются к аккаунту и повторно их уже не купить. Если вы удалите приложение и постановите заново, то покупка будет восстановлена. В нашем случае, после покупки отключения рекламы, реклама больше не будет беспокоить пользователя. Это касается и других устройств: если пользователь залогиниться на другом устройство под своим аккаунтом, то в приложение будет восстановлена покупка и реклама будет отключена.

Для работы необходимо добавить разрешение в AndroidManifest.xml:

Очень помогает официальная документация и пример из SDK.

Необходимо определить ключик в приложении – PublicKey, полученный при регистрации аккаунта на Android Market
Определяем IabHelper и инициализируем. Если удачно, то пытаемся восстановить покупки.

mGotInventoryListener – слушатель для восстановления покупок.

Теперь надо, собственно, саму покупку реализовать:

SKU_ADS_DISABLE – идентификатор товара, который вы создали в адмике Google Play. mPurchaseFinishedListener – слушатель:

Стоит отдельно поговорить о методе по верификации:

Сейчас нет никакой проверки покупок, но в реальном приложении вы должны сверять полученные данные с той сгенерированой строкой, что вы отправили в запросе на покупку. Проверять это надо на своём стороннем сервере. Для обычно приложения или офф-лайн игры это может и не критично, но для он-лайн игры это очень важно.

В принципе всё, теперь при запуске приложения просиходит проверка настроек (куда мы сохранили, что отключили рекламу):

После чего реклама уже не будет показываться.

Тестирование покупок

Сейчас довольно удобно тестировать своё приложение. Можно залить .apk как альфа/бета версию и опубликовать. При этом можно назначить группу в Google+, которая будет иметь возможность к тестированию. Если вы публикуете альфа или бета версию приложения, то в маркете она не появится, иметь доступ будет только эта группа.

Тестеры смогут осуществлять покупки. Деньги будут списываться без комиссии и будут возвращены после 15 минут после покупки. Так что, не беспокойтесь. Вот только у вас не получится протестировать приложение, если ваш аккаунт на устройстве и аккаунт издателя один и тот же =/

Полностью рабочий пример можете посмотреть на гитхабе.

Источник

Управление рекламой (android)

Реклама в приложении — это очень важный момент, а иногда и единственный заработок.

Думаю, многие задавались вопросом о том, какая реклама лучше и где ее лучше размещать. Каждое приложение индивидуально, поэтому нужно экспериментировать.

Выпускать каждый раз обновления приложения с экспериментами? Не вариант. Гораздо лучше все настройки хранить на стороне сервера, а в приложении реализовать логику показа рекламы.

Но все ли так просто?

Цель данного поста:
— внести небольшой вклад в open source (исходники, демка)
— получить адекватную критику
— найти разработчиков, которые готовы поддержать проект
— попиарить приложение Цены в Китае, где используется данный подход

Предисловие

Сразу хочу сказать, что я не очень опытный Android/Java разработчик. Программирую в основном на php (более 5 лет). Это мое первое android приложение, поэтому не судите строго.

Возможности библиотеки

Виды рекламы

— AdMob
— StartAd.mobi
— свой баннер, написанный в виде html

Отображение

— Снизу
— Сверху
— В списке (с заданным шагом)
— Внутри указанного элемента (указываем id элемента)
— Межстраничная реклама (на весь экран)

Примеры использования

AdMob снизу

AdMob smart

Если нужно растянуть на всю ширину экрана

Свой баннер сверху

В списке с шагом 15

В конкретном месте

Межстраничный баннер

Настройки на стороне сервера

Подключение к проекту

На текущий момент это не библиотека, а обычное приложение. Чтобы использовать в своем приложении нужно сделать следующее:

— перенести библиотеки из папки libs
— обновить зависимости в build.gradle

Планы на будущее

— реализовать backend для настроек на сервере. У меня это уже реализовано в проекте, но нужно как-то перенести.
— статистики показов (тоже реализовано) и кликов
— добавить больше типов рекламы
— исправить TODO и FIXME в коде
— оформить в виде библиотеки (а не в виде проекта с копирование файлов в нужные места)
— выложить в maven репозиторий

Помощь

Времени как всегда не хватает, поэтому любая помощь от разработчиков не помешает. Давайте не будем стесняться что-то делать и показывать это другим. Вспомнилась поговорка «Не бойся ошибиться, бойся не попробовать». Я не прошу реализовывать что-то сверхестественное. Просто если вы будете использовать что-то из этого в своем проекте и решите добавить что-новое, или найдете какой-то баг — не поленитесь, пришлите pull request.

Источник

Добавление AdMob рекламы в Android приложение с использованием Firebase

Предисловие

Вводим «AdMob» в Google и первым сайтом уже будет не AdMob-ский, а Google-ский сайт. После перехода на оный Вас начнут по немногу переманивать на темную сторону Firebase (недавно купленный Google).

Firebase дает довольно обширные возможности по аналитике (по крайней мере для меня, как программиста, а не маркетолога) рекламы в вашем приложениее (рост, вес, страна, кол-во просмотров, версии Android куда установливалось и тд. и тп.).

Читайте также:  Android system webview обновляется долго

Первым делом был найден пост, но он для Eclipse, а после первых попыток сделать по примеру — начались предупреждения о depricated да и вообще ошибки.

Прочитав больше информации стало понятно, что переход AdMob на firebase произошел недавно и разбиратся придется самому.

Давайте посмотрим как с этим жить теперь

Минимальные требования: (с учетом которых была написана статья).

  • Android Studio 2.2.2
  • Быть зарегистрированным в Google Developer Console
  • Быть зарегистрированным на AdMob
  • Мозг

Шаг 1

Добавляем зависимости в build.gradle файлы. Первым делом в ‘Module: app’:

Теперь во второй (‘Project: AdMobOnHabr’):

После чего рекомендуется сделать Tools → Android → «Sync Project with Gradle Files» и скомпилировать проект. Видимого результата еще нету, но главное — ошибок нету? Отлично! Идем дальше.

Шаг 2

Входим в свой аккаунт на AdMob. Выбираем ручное добавление приложения (если Ваше приложение уже опубликовано в Google Play — воспользуйтесь поиском в первой вкладке).

Добавим в наше приложение рекламный баннер (с другими видами предлагаю ознакомится самостоятельно). Частоту обновления Я выбрал минимально допустимую — 30 сек., название рекламного блока на Ваше усмотрение.

Дальше Вам предложат «Настройте Firebase Analytics (необязательно)» — нужное слово подчеркул. Пока что это ни к чему — пропускаем. Ознакамливаемся с «инструкциями по интеграции», жмем Готово. После переадресации видим страницу и долгожданный ID рекламного блока:

Добавляем ad unit ID в strings.xml:

Не забудьте, что для рекламного блока на другой Activity нужен новый ID.

Шаг 3

Добавляем AdView элемент на activity_admobbanner.xml:

В атрибут ‘ads:adUnitId’ записываем ресурс из strings.xml с ID рекламного блока.

Несколько советов и заметок:

    Не перепутайте ads и app при добавлении namespace в родительский ViewGroup;

На API Совет по Code Style тэга

Google рекомендует писать тэг закрывая так:

Шаг 4

Инициализируем Google Mobile Ads SDK. Для этого Вам понадобится app ID взятый с AdMob. Жмем шестеренку справа вверху → Управление приложением:

Вот оно, счастье нужный app ID:

Пишем саму, собственно, инициализацию используя свой app ID:

Шаг 5

Последнее действие по версии Google — загрузить долгожданную рекламу в AdView элемент:

На эмуляторе следуя политике AdMob вы не можете выводить реальную рекламу (показывается только тестовая). Довольно логично. Но если у Вас есть реальное устройство — можете протестировать рекламу в действии на нем и порадовать себя успехом.

  • Для отображения рекламы на реальном тестовом девайсе перепишите код вот так:

Остается вопрос — где взять волшебный DEVICE_ID_EMULATOR? Все в один голос рекомендуют очень «трушный» способ: пишите вместо DEVICE_ID_EMULATOR любое значение, к примеру:

После чего запускаете приложение на своем устройстве и смотрите logcat. Там найдете лог подобный этому:

Что делать дальше ясно — копируйте полученный код в метод упомянутый выше и радуйтесь жизни.

Заметка:
Дело было ночью, спать хотелось, в общем не повторяйте моих ошибок:
При поиске ID вашего реального устройства — не забудьте выбрать logcat девайса, на котором запущено приложение (у меня, к примеру, было запущено еще несколько эмуляторов и Я упорно не мог понять почему в лог эмулятора не выводится так нужный мне ID)

Вроде бы все сделали как написано, все должно работать, а нам пора ложится спать работать над следующей фичей но…

Шаг 6

Где-то между строк Вы должны были прочитать, что без google-services.json оно работать не будет. Скорее всего, даного файла у Вас еще нету. Давайте искать вместе.

Google любезно предоставляет Вам «простыни» инструкций как сделать google-services.json. Но у меня возник вопрос — неужели в 2к16 году нужно самому сидеть и писать этот файл, который, к всему, скорее всего довольно шаблонный?

Ответ находится в Google Developer Console, где все таки подумали про желание ленивого программиста.

Жмем Continue. Выбираем Google Sing-In. Дальше просто — Вы же знаете на память свой SHA-1?

Если вдруг запамятовали — могу помочь. SHA-1 можно узнать с помощью keyltool или немного по-топорному — через gradle в самой AS . Так как лишних действий делать не хочется — выберем второй способ:

Вставляем полученый SHA-1 код, жмем «Enable Google Sign-In» и «Continue to Generate configuration files».

Ну, вы поняли. Скачиваем сгенерированный файл и копируем в корневой каталог приложения:

Собираем свой проект — готово. Путем подобных несложных манипуляций в Вашем приложении теперь есть реклама.

Источник

Top Mobile Ad Networks (2021)

Updated: November 26, 2021

The Mobile advertising industry landscape consists of two major parts – Supply, that is presented by publishers and a SSP (stands for Supply Side Platform) that aggregates mobile inventory across hundreds of thousands of publishers and Demand, that is presented by a DSP (stands for Demand Side Platform) that allows advertisers to place mobile ads in publishers desktop or mobile inventory.

Drive Your App Installs: Reach 1.5B+ Users Likely To Download

Utilize AdColony’s industry expertise and proprietary machine learning algorithm to find users, appearing in pre-vetted inventory and paying only for success.

A Mobile Ad Network function is to serve a middle point between these two ends of the value chain, moving inventory across both supply and demand, either directly or via reselling or re-broking of inventory.

On some occasions, companies register with an ad network as both advertiser and publisher. Such double registration allows these companies to account traffic it generates as a publisher to cover fees it needs to pay for traffic it acquires as an advertiser.

Ad networks involvement into advertiser – publisher dynamics isn’t always limited with mobile traffic delivery and providing performance stats, sometimes, when advertisers budget is high, ad networks get involved into ad creatives production. For instance, in a case of video ads, that today run supreme of digital advertising efficiency, ad networks can substantially improve advertiser’s ad campaign efficiency and increase its revenue.

The pioneer in the mobile ad networks space was AdMob , that really took off after its acquisition in 2009 by Google, Inc. Over the course of more than 10 years since, the advertising networks space has grown with a small number of top tier companies have been controlling the market. Apart from AdMob by Google, which later become part of the Google Ads ad platform, these are Facebook, Twitter and, in a smaller degree, Snapchat and Pinterest. The paramount advantage that allows these companies to occupy the top tier of the mobile ad market is how much data they can accumulate on their registered users and leverage this data for ad campaigns precise targeting.

Now, the recent newcomers Reddit and TikTok present an interesting case. The former has one of the most diverse online communities on the planet to reach and monetize and the latter is the brand new China-based social media that is like no other US counterpart. Both are worth of advertisers attention as an alternatives (or extra options) to Facebook and Google.

Читайте также:  Fnaf remake android gamejolt

The next tier, that has survived competition with aforementioned companies and continues to compete for mobile advertisers budgets, consists of Applovin, UnityAds, ironSource and Vungle. Compared with the Google and Facebook duopoly, these four have much less data points for a mobile user profile and therefore can not target mobile ads as precise as the top tier companies. To partly negate this limitation and help advertisers achieve their goals, these companies provide account managers to handle low-level ad campaigns management.

One of the most profound shifts in the mobile ad industry is that mobile apps have become the major inventory for ads to be displayed in, replacing traditional mobile web. This shift has even coined a new term – in app advertising. There is a simple reason behind this transition – multiple researches demonstrate that people spend most of the time with mobile devices, using apps, not browsing web sites as they used to. With the number of mobile apps that continues to increase exponentially, mobile in app advertisements have a potential to replace mobile web ads completely. Today all highest paying mobile ad networks are laser focused on mobile as the fastest growing digital advertising sector.

As mobile advertising industry continues to grow, it becomes more and more apparent that moving all operations into programmatic area is the only way to go. This is how you can accommodate greater and greater advertising volumes, allow ever increasing number of advertisers to manage their ad campaigns efficiently and mobile publishers to maximize their inventory monetization.

The downside of the programmatic approach is that it produces lower engagement rates, introduces advertisers to risk of a fraud, generally it’s less relevant compared to manual ad campaigns and can even be harmful for brands in cases when their ads occasionally being placed on websites next to questionable content.

Continue the trend on advertising automation, Artificial Intelligence algorithms are praised as the way to tackle multiple challenges that digital advertising faces. In fact, AI is the technology that many industries embrace to handle big data volumes to search for patterns and valuable insights to increase its efficiency. For mobile advertising it is also a brand new way to better fight off mobile ad fraud.

Speaking of mobile ad fraud, according to Jupiter research this year it’s the advertisers fate to loose $42 billion because of a fraud. There are two kinds of digital ad fraud – technical and compliance one. The first one covers all sorts of technical ways to trick ad network into considering fake advertising events as genuine ones and the second covers multiple tactics to break the rules established on a specific advertising platform. Examples of technical fraud are ad stacking, attribution fraud, faked postbacks. The compliance fraud has to do with viewability, cases of placing ads in areas it rarely can be seen but still reported as seen, tricking users into clicking on ads, re-brokering ad offers from one publisher to another and more.

Table of Contents

Now, before we’ll start profiling top mobile ad networks, let’s define several characteristics to describe a mobile ad network.

Mobile Advertising Business Models

All mobile ad networks provide users with several types of business models to run ad campaigns with. There are 5 major types – CPM, CPC, CPI, CPA and CPV.

With CPM (cost-per-mile) type, an advertiser is charged each time her or his ads are shown 1,000 times (so-called ‘a mile’). It’s the best business model for publishers, because it allows to make money every time an ad was displayed. If they have a stable predictable traffic, it allows publishers to forecast their revenue. The down side is that they may loose some extra revenue, if their app or website audience is really interested in a product or service they advertise. For that case CPC model would allow them to make more money.

With CPC (cost-per-click) model an advertiser is charged for each click made on her or his mobile ads. This model works better for advertisers, because it allows them to pay only for instances when an interest to their product or service is explicit (their ads were clicked) and, as mentioned above, in some cases may work for publishers as well. For a publisher this model always presents a certain risk of him serving lots of ad impressions for free.

CPI (cost-per-instal) model implies that advertisers are charged only when a click on their ads resulted into an actual mobile app install. It’s a specific case of a more generic CPC business model. Cost-per-install price has become one of the most important metrics for mobile app marketers to measure and keep track of, because essentially it represents a price they pay to acquire customers and hence it should be factor into ROI calculations.

CPA (cost-per-action) type is more advanced version of CPI, when an advertiser is charged for specific action (in-app sale, subscription, form submit, sign up and more) users take inside an app that is advertised on a mobile ad network. This type of a business model presents more opportunities for publishers to monetize their inventory on one hand and more options for advertisers to grow their business on the other.

And finally CPV (cost-per-view) type is applicable to mobile ad networks that provide advertisers with video ad campaigns. With this model, advertisers are charged for each instance their video mobile ad was viewed. With the current pace of a video advertising growth, this model becomes more and more popular.

Top Mobile Ad Networks

  • AdColony — The In-App Marketplace for Brands
  • URLgenius — Codeless App Linking and QR Codes
  • Zoomd — Know More, Do More
  • AdQuantum — Performance Marketing Agency
  • Adlane — Ad Network for Publishers and Website Owners
  • 3.14 Mobitech — Mobile Advertising the way it should be
  • Remerge — Growth Specialist for App Businesses
  • Performcb — #1 Performance Marketing Network Worldwide
  • Kevel — Build a custom ad server in just weeks.
  • PubMatic — The Future of Programmatic. Delivered
  • Growth FullStack — Custom BI for advertisers of all sizes
  • RichAds — #1 Mobile Ad Network for Scaling Ad Campaigns
  • Hitapps — Expert in digital advertising and app development since 2017.
  • ConsoliAds — Mobile App Growth Made Quick & Easy
  • Adjust — Mobile Measurement Partner
  • Mobupps — A One Stop Shop For All Your Mobile Marketing Needs
  • Adikteev — Data-driven app marketing platform
  • SocialPeta — Ads Intelligence Tool For Marketing Strategy
  • InMobi — Driving Real Connections
  • JustControl.it — Get Your Digital Marketing Under Control
  • Bidease — #1 DSP for mobile app marketers
  • Entravision — Entravision is the leading Performance One-Stop-Shop Digital Marketing Company
  • HUAWEI Ads — Mobile Marketing Platform tailored for HUAWEI devices
  • MAAS powered by Affle — Unified Audience Platform for Mobile User Growth
  • Smadex — Mobile-first DSP For Transparent Performance (Apps/Branding/VAS)
  • AdsCompass — Global Ad network for Publishers and Advertisers
  • myAppFree — High Quality Mobile Traffic & Exclusive Placements on SONY Xperia, Native SDK
  • AppsFlyer — Mobile marketing attribution and analytics
Читайте также:  Хорошие почтовые клиенты android

Mobile Ad Formats

There are 5 major formats supported by top mobile ad networks – interstitial, banner ads, native ads, video ads and offer wall.

Interstitial ads

A full screen ads that cover the interface of their host application. This mobile ad format is most frequently used to display an ad between different app screens and it’s quite often displayed between different levels in a mobile game app.

A classical static or animated image ad, which is placed inside an app’s interface. Such ad may advertise a third party product, other digital or physical goods, as well as an option to expand an app’s functionality.

Native ads

Either a banner image or video ad that matches the form and function of the app interface it’s displayed in. The core concept of native ads to mimic an app’s interface to be least intrusive compared to other ad formats.

OfferWall ads

It is an ad unit within a mobile app that provides end users with lots of offers to engage with. The most frequent use case is mobile games, where offerwalls may either advertise third party games or a series of games from the same game developer.

Video ads

Video ads consist of a short, usually up-to 60 seconds, video clip to advertise products and services. This mobile ad format is most often used within media apps. There are two major types of video ads – in-stream and out-stream. With in-stream type, video ads are displayed full-screen before, after and within video content that is streamed inside an app. With out-stream type video ads are displayed on a web page, displayed inside a mobile app.

Mobile Ads Reporting

An advertising campaign performance data reporting is one of the key components that is crucial for its success. This information is provided by mobile ad networks to advertisers via an online dashboard. It includes data on such parameters of ads performance as number of impressions, clicks, installs, video ad views, platform, country, ad format and so on.

Mobile Ads Targeting

There are number of parameters that allow to narrow down a mobile ad campaign reach to a specific audience. These parameters are called targeting options, there are a number of such options but the majors are the following:

Geo

It allows to narrow down an ad campaign within a specific country or region. It enables mobile marketers to advertise a product or service that is relevant only within a specific region.

Device

It allows to show ads on specific models of mobile devices only. This type of targeting lets advertisers to display ads on devices with a specific screen size and other hardware requirements, which allows to avoid a mobile ad experience degradation.

Carrier

With this option, it’s possible to show ads only to mobile users, who are served by a specific mobile carrier. It presents advertisers an opportunity to display ads to mobile users, those mobile carrier provides a better mobile signal reception in a specific area.

OS

it allows to show ads on mobile devices running specific operating system or even particular versions of OS. It gives advertisers a benefit of displaying ads to mobile users on devices that are best to display those ads software wise.

Connection

By applying this targeting option, it’s possible to show mobile ads on mobile devices when they are connected to the Internet either via Wifi or 3G/LTE connection.

Interests

mobile ad network that collect mobile users data and build their profile allows to narrow down an ad campaign on an audience segment with specific interests only.

Gender

This option allows to narrow down an ad campaign to mobile users of a particular gender. Naturally, just like with any kind of advertising such targeting is aimed to market goods specifically to females and males.

One of the best sources to check a particular mobile ad network performance is the AppsFlyer semi-annual Performance Index. Below you can see the snippet from the H1, 2019 edition and it covers media sources performance for both gaming and non-gaming apps for iOS and Android operating system.

In the table, Volume Ranking based on the total number of non-fraudulent installs each was attributed for, Power Ranking based on the normalized and combined number of non-fraudulent installs, the number of apps running with each media source and the weighted retention score.

Mobile Advertising rankings

Top 10 Media Sources [both iOS and Android]

# Gaming Power Gaming Volume Non-Gaming Power Non-Gaming Volume
1 Google Ads Google Ads Google Ads Google Ads
2 Facebook Ads Facebook Ads Facebook Ads Facebook Ads
3 AppLovin ironSource

Apple Search Ads Apple Search Ads
4 UnityAds UnityAds Twitter Ads TikTok Ads
5 ironSource AppLovin Google Marketing Platform Snapchat Ads
6 Apple Search Ads Vungle Snapchat Ads UnityAds
7 Mintegral Mintegral Liftoff ironSource
8 Vungle TikTok Ads ironSource AppLovin
9 Snapchat Ads Tapjoy AppLovin Liftoff
10 Twitter Ads Snapchat Ads TikTok Ads Twitter Ads

Another company that provides data to measure mobile ad networks performance is Singular – the mobile marketing analytics platform that issued earlier this year the Singular ROI Index. It’s compiled based on the data Singular derived from more than 550+ mobile media sources, 2.2 billion installs with matching ROI, $6.3 billion in advertising spend. The index factors in a number of metrics, such as mobile user retention, revenue per install and what is the most important – the cost to drive app users engagement.

This year Index does’t rate the companies that got on the list due to really narrow margins in their performance.

Singular ROI Index Top 10 [iOS app data]

Singular ROI Index Top 10 [Android app data]

Now let’s take a look at the list of top mobile ad networks of 2020 we’ve compiled for app developers and mobile business owners to find the right one to work with. To compile this list we researched the major players in the mobile advertising field, included companies that offer the wide range of ad formats and targeting options, as well as robust statistics and good technical support.

Источник

Оцените статью