Stay organized with collections
Save and categorize content based on your preferences.
This guide shows you how to use the Google Mobile Ads SDK to load and display
ads from Tapjoy using mediation,
covering both bidding and waterfall integrations. It covers how to add Tapjoy
ads to an ad unit's mediation configuration, and how to integrate the Tapjoy SDK
and adapter into an Android app.
Supported integrations and ad formats
The AdMob mediation adapter for Tapjoy has the
following capabilities:
Add your app to the Tapjoy dashboard by going to the apps
list on the top right and clicking the Add App button. You are then prompted
to enter details about your app.
Fill out the form and click the Create Now button to add your app to the
Tapjoy dashboard.
You can skip the integration steps presented by Tapjoy and 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.
Enter a Name for your placement, check the Mediation checkbox, and
select AdMob from the drop down list. Click Create when done.
The Placement Name entered here is 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
Navigate to Monetization > Virtual Currency and click the Create Virtual
Currency button in the top right corner.
Fill out 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.
The currency value and name are not forwarded by the Tapjoy adapter, so any
generic values can be chosen for your currency name and amount.
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:
In addition to the Placement Name, you also need the SDK Key for setting up
your AdMob ad unit.
Navigate to Settings > App Settings. Your SDK Key can be obtained from
your App Info under the Application Platforms tab.
Locate reporting keys
Bidding
This step isn't required for bidding integrations.
Waterfall
You need your Publisher OAuth Key and your Mediation Key to proceed.
Your Publisher OAuth Key can be obtained in the same page under the
API Keys tab.
Your Mediation Key can be obtained in the same page under the
Mediation Keys tab under the Reporting API Key column. The key is
labeled "AdMob."
Turn on test mode
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:
Your device's **Advertising ID** can be located by navigating to **Google >
Ads** in your device **Settings**.
Next, modify the content you created earlier.
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.
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.
Step 2: Set up Tapjoy demand in AdMob UI
Configure mediation settings for your ad unit
You need to add Tapjoy to the mediation
configuration for your ad unit.
First, sign in to your AdMob account. Next, 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.
To create a new mediation group, select Create Mediation Group.
Enter your ad format and platform, then click Continue.
Give your mediation group a name, and select locations to target. Next, set the
mediation group status to Enabled, and then click Add Ad Units.
Associate this mediation group with one or more of your existing
AdMob ad units. Then click Done.
You should now see the ad units card populated with the ad units you selected:
Add Tapjoy as an ad source
Bidding
Under the Bidding card in the Ad Sources section, select Add
Ad Source. Then select Tapjoy.
Download the Tapjoy Android SDK and
extract the tapjoyconnectlibrary.jar under the Libraries folder and add it
to your project.
Navigate to the
Tapjoy adapter artifacts
on Google's Maven Repository. Select the latest version, download the Tapjoy
adapter's .aar file, and add it to your project.
Step 4: Implement privacy settings on Tapjoy SDK
EU consent and GDPR
Under the Google EU User Consent
Policy, you must ensure that certain disclosures are given to, and
consents obtained from, users in the European Economic Area (EEA) regarding
the use of device identifiers and personal data. This policy reflects the
requirements of the EU ePrivacy Directive and the General Data Protection
Regulation (GDPR). When seeking consent, you must identify each ad network
in your mediation chain that may collect, receive, or use personal data and
provide information about each network's use. Google currently is unable to
pass the user's consent choice to such networks automatically.
In Tapjoy SDK version 12.6.0, Tapjoy added a user consent API to support privacy
settings. The following sample code shows how to pass this consent information
to the Tapjoy SDK. If you choose to call this method, it is recommended that you
do so prior to requesting ads through the Google Mobile Ads SDK.
import com.tapjoy.Tapjoy
...
val privacyPolicy = Tapjoy.getPrivacyPolicy()
privacyPolicy.setSubjectToGDPR(true)
privacyPolicy.setUserConsent("0")
Visit Tapjoy's
User Privacy guide
for more details and the values that can be provided in each method.
US states privacy laws
U.S. states privacy laws
require giving users the right
to opt out of the "sale" of their "personal information" (as the law defines
those terms), with the opt-out offered via a prominent "Do Not Sell My Personal
Information" link on the "selling" party's homepage. The
U.S. states privacy
laws compliance guide offers the ability to enable
restricted data processing
for Google ad serving, but Google is unable to apply this setting to each ad
network in your mediation chain. Therefore, you must identify each ad network
in your mediation chain that may participate in the sale of personal
information and follow guidance from each of those networks to ensure
compliance.
In Tapjoy SDK version 12.6.0, Tapjoy added a user consent API to support privacy
settings. The following sample code shows how to pass this consent information
to the Tapjoy SDK. If you choose to call this method, it is recommended that you
do so prior to requesting ads through the Google Mobile Ads SDK.
To verify that you are receiving test ads from
Tapjoy,
enable
single ad source testing
in ad inspector using the Tapjoy (Bidding) and Tapjoy (Waterfall) ad
source(s).
Optional steps
Add Tapjoy to CCPA ad partners list
Follow the steps in
CCPA settings
to add Tapjoy to the CCPA ad partners list in the
AdMob UI.
Permissions
For optimal performance, Tapjoy recommends adding the following optional
permissions
to your app's AndroidManifest.xml file:
The Tapjoy adapter supports an additional request parameter which can be passed
to the adapter using the TapjoyExtrasBundleBuilder class. The
TapjoyExtrasBundleBuilder includes the following method:
setDebug(bool)
Enabling debug mode on Tapjoy SDK enables you to see various Tapjoy actions
in the Tapjoy Developer Console. This param is supported for all ad formats.
Here's a code example of how to set these ad request parameters:
Java
Bundle extras = new TapjoyAdapter.TapjoyExtrasBundleBuilder()
.setDebug(true)
.build();
AdRequest adRequest = new AdRequest.Builder()
.addNetworkExtrasBundle(TapjoyAdapter.class, extras)
.build());
Kotlin
val extras = TapjoyExtrasBundleBuilder()
.setDebug(true)
.build()
val adRequest = AdRequest
.addNetworkExtrasBundle(TapjoyAdapter::class.java, extras)
.build()
Verify your adapter and SDK versions
To log the adapter and SDK versions, use the following code snippet:
TapjoyMediationAdapter adapter = new TapjoyMediationAdapter();
VersionInfo adapterVersion = adapter.getVersionInfo();
VersionInfo sdkVersion = adapter.getSDKVersionInfo();
// Log the adapter patch version to 3 digits to represent the x.x.x.x versioning
// used by adapters.
Log.d("TAG", String.format(
"Adapter version: %d.%d.%03d",
adapterVersion.getMajorVersion(),
adapterVersion.getMinorVersion(),
adapterVersion.getMicroVersion()));
Log.d("TAG", String.format(
"SDK version: %d.%d.%d",
sdkVersion.getMajorVersion(),
sdkVersion.getMinorVersion(),
sdkVersion.getMicroVersion()));
Error codes
If the adapter fails to receive an ad from Tapjoy, you can check the underlying
error from the ad response using
ResponseInfo.getAdapterResponse()
under the following classes:
Format
Class name
Interstitial
TapjoyAdapter
Rewarded
TapjoyMediationAdapter
Here are the codes and accompanying messages thrown by the Tapjoy adapter
when an ad fails to load:
Error code
Reason
101
Tapjoy server parameters configured in the AdMob UI are missing/invalid.
103
The publisher must request ads with an Activity context.
104
Tapjoy SDK failed to initialize.
105
A Tapjoy presentation error occurred during video playback.
106
Tapjoy SDK can't load two ads for the same placement ID at once.
107
App did not request for native ads.
108
Tapjoy SDK has no ad content available.
Tapjoy Android Mediation Adapter Changelog
Version 13.2.1.0
Updated the minimum required Google Mobile Ads SDK version to 22.3.0.
Verified compatibility with Tapjoy SDK version 13.2.1.
Built and tested with:
Google Mobile Ads SDK version 22.3.0.
Tapjoy SDK version 13.2.1.
Version 13.1.2.0
Verified compatibility with Tapjoy SDK version 13.1.2.
Built and tested with:
Google Mobile Ads SDK version 22.2.0.
Tapjoy SDK version 13.1.2.
Version 13.1.1.0
Verified compatibility with Tapjoy SDK version 13.1.1.
Built and tested with:
Google Mobile Ads SDK version 22.1.0.
Tapjoy SDK version 13.1.1.
Version 13.0.1.0
Verified compatibility with Tapjoy SDK version 13.0.1.
Built and tested with:
Google Mobile Ads SDK version 22.0.0.
Tapjoy SDK version 13.0.1.
Version 13.0.0.0
Verified compatibility with Tapjoy SDK version 13.0.0.
Updated adapter to use new VersionInfo class.
Updated the minimum required Google Mobile Ads SDK version to 22.0.0.
Built and tested with:
Google Mobile Ads SDK version 22.0.0.
Tapjoy SDK version 13.0.0.
Version 12.11.1.0
Verified compatibility with Tapjoy SDK version 12.11.1.
Updated the minimum required Google Mobile Ads SDK version to 21.3.0.
Built and tested with:
Google Mobile Ads SDK version 21.3.0.
Tapjoy SDK version 12.11.1.
Version 12.11.0.0
Verified compatibility with Tapjoy SDK version 12.11.0.
Updated the minimum required Google Mobile Ads SDK version to 21.2.0.
Built and tested with:
Google Mobile Ads SDK version 21.2.0.
Tapjoy SDK version 12.11.0.
Version 12.10.0.1
Updated compileSdkVersion and targetSdkVersion to API 31.
Updated the minimum required Google Mobile Ads SDK version to 21.0.0.
Updated the minimum required Android API level to 19.
Built and tested with:
Google Mobile Ads SDK version 21.0.0.
Tapjoy SDK version 12.10.0.
Version 12.10.0.0
Verified compatibility with Tapjoy SDK version 12.10.0.
Built and tested with:
Google Mobile Ads SDK version 20.6.0.
Tapjoy SDK version 12.10.0.
Version 12.9.1.0
Verified compatibility with Tapjoy SDK version 12.9.1.
Updated the minimum required Google Mobile Ads SDK version to 20.6.0.
Built and tested with:
Google Mobile Ads SDK version 20.6.0.
Tapjoy SDK version 12.9.1.
Version 12.9.0.0
Verified compatibility with Tapjoy SDK version 12.9.0.
Updated the minimum required Google Mobile Ads SDK version to 20.5.0.
Built and tested with:
Google Mobile Ads SDK version 20.5.0.
Tapjoy SDK version 12.9.0.
Version 12.8.1.1
Verified compatibility with Tapjoy SDK version 12.8.1.
Updated the minimum required Google Mobile Ads SDK version to 20.4.0.
Fixed an issue where a crash could occur if Tapjoy's TJError.message field is null.
Built and tested with:
Google Mobile Ads SDK version 20.4.0.
Tapjoy SDK version 12.8.1.
Version 12.8.1.0
Verified compatibility with Tapjoy SDK version 12.8.1.
Fixed an issue where a NullPointerException is being logged when an error is logged by the adapter.
Updated the minimum required Google Mobile Ads SDK version to 20.2.0.
Built and tested with:
Google Mobile Ads SDK version 20.2.0.
Tapjoy SDK version 12.8.1.
Version 12.8.0.1
Updated the minimum required Google Mobile Ads SDK version to 20.0.0.
Built and tested with:
Google Mobile Ads SDK version 20.0.0.
Tapjoy SDK version 12.8.0.
Version 12.8.0.0
Fixed incorrect error messages.
Updated the minimum required Google Mobile Ads SDK version to 19.7.0.
Built and tested with:
Google Mobile Ads SDK version 19.7.0.
Tapjoy SDK version 12.8.0.
Version 12.7.1.0
Verified compatibility with Tapjoy SDK version 12.7.1.
Updated the minimum required Google Mobile Ads SDK version to 19.5.0.
Built and tested with:
Google Mobile Ads SDK version 19.5.0.
Tapjoy SDK version 12.7.1.
Version 12.7.0.0
Fixed an issue where the adapter returns an incorrect version string.
Updated the minimum required Google Mobile Ads SDK version to 19.4.0.
Built and tested with:
Google Mobile Ads SDK version 19.4.0.
Tapjoy SDK version 12.7.0.
Version 12.6.1.0
Verified compatibility with Tapjoy SDK version 12.6.1.
Loading multiple interstitial ads with the same Tapjoy placement name at once now results in a load error for the second request. This behavior now matches existing behavior for rewarded ads.
Built and tested with:
Google Mobile Ads SDK version 19.2.0.
Tapjoy SDK version 12.6.1.
Version 12.6.0.0
Verified compatibility with Tapjoy SDK version 12.6.0.
Updated the minimum required Google Mobile Ads SDK version to 19.2.0.
Built and tested with:
Google Mobile Ads SDK version 19.2.0.
Tapjoy SDK version 12.6.0.
Version 12.4.2.1
Added descriptive error codes and reasons for adapter load/show failures.
Updated the minimum required Google Mobile Ads SDK version to 19.0.1.
Built and tested with:
Google Mobile Ads SDK version 19.0.1.
Tapjoy SDK version 12.4.2.
Version 12.4.2.0
Verified compatibility with Tapjoy SDK version 12.4.2.
Built and tested with:
Google Mobile Ads SDK version 18.3.0.
Tapjoy SDK version 12.4.2.
Version 12.4.1.0
Verified compatibility with Tapjoy SDK version 12.4.1.
Built and tested with:
Google Mobile Ads SDK version 18.3.0.
Tapjoy SDK version 12.4.1.
Version 12.4.0.0
Verified compatibility with Tapjoy SDK version 12.4.0.
Built and tested with:
Google Mobile Ads SDK version 18.3.0.
Tapjoy SDK version 12.4.0.
Version 12.3.4.0
Verified compatibility with Tapjoy SDK version 12.3.4.
Updated the minimum required Google Mobile Ads SDK version to 18.3.0.
Built and tested with:
Google Mobile Ads SDK version 18.3.0.
Tapjoy SDK version 12.3.4.
Version 12.3.3.0
Verified compatibility with Tapjoy SDK version 12.3.3.
Version 12.3.2.0
Verified compatibility with Tapjoy SDK version 12.3.2.
Updated the minimum required Google Mobile Ads SDK version to 18.2.0.
Version 12.3.1.1
Tapjoy Adapter now only requests a single ad for every placement.
Version 12.3.1.0
Updated the adapter to invoke 'onClick()' ad event.
Verified compatibility with tapjoy SDK version 12.3.1.
Updated the minimum required Google Mobile Ads SDK version to 17.2.1.
Version 12.2.1.1
Added bidding capability to the adapter for interstitial and
rewarded ads.
Version 12.2.1.0
Verified compatibility with tapjoy SDK version 12.2.1.
Version 12.2.0.1
Updated adapter to support new open-beta Rewarded API.
Updated the minimum required Google Mobile Ads SDK version to 17.2.0.
Version 12.2.0.0
Verified compatibility with tapjoy SDK version 12.2.0.
Version 12.1.0.0
Verified compatibility with tapjoy SDK versiobn 12.1.0.
Version 12.0.0.1
Updated the adapter to invoke the onRewardedVideoComplete() ad event.
Version 12.0.0.0
Verified compatibility with tapjoy SDK versiobn 12.0.0.
Version 11.12.2.0
Verified compatibility with tapjoy SDK versiobn 11.12.2.
Version 11.12.1.0
Verified compatibility with tapjoy SDK versiobn 11.12.1.
Version 11.12.0.0
Verified compatibility with tapjoy SDK versiobn 11.12.0.
Version 11.11.1.0
Verified compatibility with Tapjoy SDK version 11.11.1.
Version 11.11.0.0
Updated the adapter to make it compatible with Tapjoy SDK version 11.11.0.
Version 11.10.2.0
Updated the default reward amount to 1.
Verified compatibility with Tapjoy SDK version 11.10.2.
Version 11.10.1.0
Verified compatibility with Tapjoy SDK version 11.10.1.
Version 11.10.0.0
Verified compatibility with Tapjoy SDK version 11.10.0.
Version 11.9.1.0
Initial release. Supports reward-based video ads and interstitial ads.