How-to: Create an Opt-In Placement for Fun and Profit





App monetization isn’t a new thing. It’s been an intrinsic part of mobile development since the dawn of the first App Stores, but for many mobile developers it remains misunderstood. Monetization doesn’t need to be an onslaught of unrelatable, uninteresting endorsements – it can be a healthy break from intense game play. It can be the breath before the plunge. It can, it should, be an engaging experience that leaves the user excited to get back into the best parts of the app.

The best performing apps, both in monetization and in user satisfaction, take care to create experiences like this for the user. They aren’t abusing the user’s time or filling every possible ad space with distracting graphics – they’re following time-tested approaches to ad-based monetization. There are a lot of creative ways to monetize without alienating your users, but today I want to cover one of my personal favorites, the opt-in placement.

The Value of Opt-In

Through an opt-in placement we’ll ask the user to choose to watch an ad in exchange for an in-game reward.

The act of choosing is doubly important – it verifies the value of the reward and ensures the user is re-engaged with the app for the ad experience.

So now, you’re probably asking…

How Do I Add an Opt-In Placement?

Great question. Let’s run through an extension of our previous post on rapid monetization. We’d like to add more monetization to the app, in this case, on some additional features that aren’t critical to the regular game flow. Here’s what we’ll do:

1.  Lock Settings by Default

We’re targeting our Settings menu for monetization, which gives users the ability to change the difficulty, color scheme, or board dimensions of the game. We want users to feel rewarded when they gain access to Settings, so we’ll restrict it by default. We can update the initial Settings button title to ‘Unlock?’ to let users know there are still features to discover.

 

unlock

 

2.  Persist an Unlock Timestamp Setting
We’ll need to store the unlock state of our Settings feature somewhere – users shouldn’t need to unlock the feature again just because they’ve closed the app. We can store an unlock timestamp in NSUserDefaults, but note the unlockPeriod variable – by limiting the unlock time to a single day we’re able to continually monetize returning users that want to customize their 2048 experience. We don’t have to overwhelm them with numerous non-impactful ads, we can show them a single ad while we know they’re engaged with the application.

 

bool

 

3.  Present the Opt-In Dialog

Presenting the user with the option to unlock settings will be pretty straight forward for us. We’ll use a default UIAlertController with two options (Cancel, OK). The completion block tied to the OK UIAlertAction will present an incentivized ad, while the one tied to Cancel will simply close the alert and allow the user to continue along with their game.
alertController_snippet

 

4.  Play an Incentivized Ad

Incentivized ads are a bit different from regular ads in the Vungle ecosystem through their settable options in the Vungle Dashboard, but what we’re interested in today is the custom incentivizedAlertText, which can be set in the SDK. This allows us to customize the alert that is presented to the user if they try to close the video before it’s completed. In this case, we can use it to reinforce that Settings will remain locked until the user has successfully completed an ad view.

 

playIncentivizedAd_snippet

 

5.  Handle the willCloseAd Callback

We don’t want to store our unlock timestamp immediately after the user chooses to watch the video ad. There could be problems delivering the video, or the user could close out of the ad experience before the ad has completed. To ensure that the user watched the entire ad we can set our M2ViewController as our SDK’s VungleSDKDelegate. Once set, our view controller will be notified during a few specific SDK events. We’ll want to write the unlock timestamp to our NSUserDefaults only after a successful callback to vungleSDKwillCloseAdWithViewInfo.

 

vungleSDKDelegate_willCloseAd_snippet

 

And we’re done!  An opt-in ad placement has been added to our 2048 clone. It should look like this:

 

completeOptIn

 

We’re always looking for ways to make our tools easier to use and faster to implement, so shoot us an email at editorial at vungle dot com if you’ve got some improvements you’d love to see added! And if you’re interested in a closer look at the source code for this project, we’ve got it here.

To monetize with the Vungle platform you’re going to need to sign-up for a Vungle account and add your app. Get one here or visit Github for more details on integration!