Integrating Tapjoy with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from Tapjoy via mediation. It covers how to add Tapjoy to an ad unit's mediation configuration, how to set up Ad Network Optimization (ANO), and how to integrate the Tapjoy SDK and adapter into an iOS app.

Supported formats and platforms

The AdMob mediation adapter for Tapjoy has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Native Advanced
Features
Smart Banners
Ad Network Optimization (ANO)

Requirements

  • Xcode 6.0 or higher
  • iOS Deployment target of 7.0 or higher
  • Minimum required Google Mobile Ads SDK 7.10.1 or higher

Step 1: Set up Tapjoy

Sign up and log in to your Tapjoy dashboard.

Add app

Figure: Monetization overview screen

Add your app to the Tapjoy dashboard by going to the apps list on the top right and clicking + Add App button. You will be prompted to enter details about your app.

Figure: Create your app now dialog

Fill out the form and click the Create Now button to add your app to Tapjoy dashboard.

You can skip the integration steps presented by Tapjoy and can move on to creating placements to be used with AdMob mediation.

Placement, virtual currency and content

Placement

Navigate to Monetization > Placements and click the Create Placement button in the top right corner. Even if you have an existing placement, it's best to create a new one for AdMob, so it can be tracked and reported on separately.

Figure: Create Placement dialog

Enter a Name for your placement and set the Type to At a fixed location outside of gameplay (in-app store, setting etc.), so the placement will be created under User Initiated section. Check the Mediation checkbox and select AdMob from the drop down list. Click Create when done.

The Placement Name entered here will be used to set up your AdMob Ad Unit for mediation in the next section. "AdMob Mediation" has been used in this example, but you can call your placement whatever you like.

Virtual currency

Figure: Virtual Currency screen

Navigate to Monetization > Virtual Currency and click the Create Virtual Currency button in the top right corner.

Figure: Create Virtual Currency screen

Fill the form and click Create now. Use NO_CALLBACK as the Callback URL. This ensures that the Tapjoy SDK avoids an unnecessary call to your server.

Content

Navigate to Monetization > Create Content to create Content to be shown with the placements.

For additional instructions on creating Content, select the tab corresponding to your preferred ad format.

Interstitial

Figure: Create content page

Click the Create button for the Interstitial Content.

Figure: Basic section for Interstitial Content

Provide a Name for the Content and choose iOS as the Platform.

Figure: Placements section for Interstitial Content.

Select the Interstitial placement created earlier.

Figure: Virtual Currency section for Interstitial Content.

Select the virtual currency created earlier as the Virtual Currency.

Click the Save button at the bottom when finished to create your Content.

Rewarded Video Ads

Figure: Create content page

Click the Create button for Video Content.

Figure: Basic section for Video Content

Provide a Name for the Content and choose iOS as the Platform.

Figure: Placements section for Video Content

Select the rewarded video placement created earlier.

Figure: Virtual Currencies section for Video Content.

Select the virtual currency created earlier as the Virtual Currency.

Figure: Reward Options section for Video Content.

Select Fixed Rewards as the Reward Type. In Google Mediation, the Tapjoy adapter only supports fixed rewards.

Click the Save button at the bottom when finished to create your Content.

SDK and reporting keys

In addition to the Placement Name you also need the SDK Key, Publisher OAuth Key, and Mediation Key for setting up your AdMob ad unit.

Navigate to Settings > App Settings

SDK key

Figure: Basic info - Application platforms tab

Your SDK Key can be obtained from your App Info under the Application Platforms tab.

Publisher oauth key

Figure: Basic info - API Keys tab

Your Publisher OAuth Key can be obtained in the same page under the API Keys tab.

AdMob API key

Figure: Basic info - Mediation Keys tab

Your AdMob Mediation Key can be obtained in the same page under the Mediation Keys tab under the Reporting API Key column.

Step 2: Configure mediation settings for your AdMob Ad Unit

You need to add Tapjoy to the mediation configuration for your Ad Unit. First sign into the AdMob UI.

Next, follow the instructions for either AdMob or AdMob Beta depending on which version of the AdMob UI you're using.

AdMob

Navigate to Monetize tab and select your application from the list of all your applications on the left-hand side. A list of ad units associated with your application will be shown.

Figure: Ad Unit details screen

Click the link in the mediation column for the ad unit you'd like to configure with Tapjoy.

You will be taken to the ad unit's Mediation page.

Figure: Mediation details screen

Click + NEW AD NETWORK.

A list of supported ad networks will be shown.

Figure: Select ad networks screen

Select Tapjoy from the list of networks provided and enter the Placement Name and SDK Key obtained in the previous section.

Enter your Publisher OAuth Key and Mediation Key obtained in the previous section to set up ANO for Tapjoy.

Click Continue at the bottom of the page to complete adding the network. Enter an eCPM value for Tapjoy and click Save.

AdMob Beta

Navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add Tapjoy as an ad source.

Figure: Mediation details screen

To create a new mediation group, select Create Mediation Group.

Figure: New mediation group screen.

Enter your ad format and platform, then click Continue.

Figure: New mediation group details screen

Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled. Then click Add Ad Units.

Ad units selection overlay.

Figure: New mediation group details screen

Associate this mediation group with your existing AdMob ad unit. Then click Done.

You should now see the ad units card populated with the ad units you selected as shown below:

Figure: Ad units card.

Add Tapjoy as an ad source

In the Ad Sources card, select Add Ad Network.

Figure: Add ad network dialog

Select Tapjoy and enable the Optimize switch. Enter your Publisher OAuth Key and Mediation Key obtained in the previous section to set up ANO for Tapjoy. Then enter an eCPM value for Tapjoy and click Continue.

Figure: Tapjoy: Configure ad units screen

Next, enter the SDK Key and Placement Name obtained in the previous section. Then click Done.

Finally, click Save.

Using rewarded video ads

Figure: Rewarded video ad unit settings

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using AdMob mediation so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the Tapjoy adapter defaults to a reward of type "" (empty string) with value 1. The Tapjoy SDK does not provide specific reward values for its rewarded video ads.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

Step 3: Import the Tapjoy SDK and adapter

  • Add the following line to your project's Podfile:

    pod 'GoogleMobileAdsMediationTapjoy'

  • From the command line run:

    pod install --repo-update
    

Manual integration

  • Download the latest version of the Tapjoy SDK, and link Tapjoy.embeddedframework in your project.

  • Download the latest version of the TapjoyAdapter, and link TapjoyAdapter.framework in your project.

Step 4: Additional code required

No additional code is required for Tapjoy integration.

Step 5: Test your implementation

Test ads can be enabled on the Tapjoy dashboard under Settings > App Settings > Test Devices. Create a new test device using the device's Advertising ID as shown below:

Figure: Create test device dialog

To get your device's advertising ID, add the following code in your app. Make sure to import AdSupport framework into your app before using the code below.

NSString *advertisingId = [[[ASIdentifierManager sharedManager]
advertisingIdentifier] UUIDString];
NSLog(@"Advertising ID: %@", advertisingId);

Next, modify the Content you created earlier.

Figure: Placements screen

To modify your content, first navigate to Monetization > Placements and click the User Initiated tab. Next, select the drop down for the content you want to edit, and choose Edit.

Figure: Edit: Interstitial content screen

Under the Content's Basic section, check the Only for Test Devices checkbox. Then click Save at the bottom of the page.

That's it! You now have a working mediation integration with Tapjoy.

Optional steps

Network-specific parameters

The Tapjoy adapter supports an additional request parameter that can be passed to the adapter using the GADMTapjoyExtras class. This class includes the following property:

  • debugEnabled - Set this to YES to enable logging in Tapjoy SDK for debug mode.

Here's a code example of how to set this parameter at ad request:

GADRequest *request = [GADRequest request];
GADMTapjoyExtras *extras = [[GADMTapjoyExtras alloc] init];
extras.debugEnabled = YES;
[request registerAdNetworkExtras:extras];

发送以下问题的反馈:

此网页
AdMob for iOS
AdMob for iOS
需要帮助?请访问我们的支持页面