Table of Contents
This page describes how to integrate the Tapjoy SDK into your Unity application if you are using Tapjoy for Pay-Per-Install (PPI or CPI) campaigns.
PPE (Pay Per Engagement) campaigns
Note that as of April 2019, PPE is no longer available on iOS, as per Apple policy.
If you are using Tapjoy to integrate a PPE campaign (also known as PPA or CPE), you need to follow some additional steps after completing the steps in this guide.
Note that if you are also publishing with Tapjoy (i.e. using it for analytics or to show ads or messages) you can simply follow the integration instructions for Publishers. If you follow those instructions, you will have done everything necessary for the Tapjoy campaign tracking to work. Please see the Getting Started Guide Unity for Publishers.
The first thing you need to do is set up your application on the Tapjoy dashboard. To do this, click the icon at the top left of the dashboard and select “+ Game/App” from the drop down menu.
Once your application has been set up on the Dashboard, you can begin to integrate the SDK in your code.
The first step in integrating with your app is to download the Unity SDK itself.
The Tapjoy Unity Plugin zip contains a Unity package file for easy importing, and the raw files for those who prefer to drag-n-drop files for their Tapjoy upgrade. To import the
- Open your Unity project
- Assets -> Import Package -> Custom Package..
- Point to the
- Review the list of import files checking for any conflicts
- Press the “Import” button to accept the files
IMPORTANT, if you are using Unity 3.5, Uncheck
Add App Permissions and Activities (for Android)
The following permissions are needed:
<manifest ...> ... <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> ... </manifest>
To use Tapjoy’s full functionality, add these activities to the
AndroidManifest.xml file in the Application block:
<activity android:name="com.tapjoy.TJCOffersWebView" android:configChanges="orientation|keyboardHidden|screenSize" /> <activity android:name="com.tapjoy.TapjoyFullScreenAdWebView" android:configChanges="orientation|keyboardHidden|screenSize" /> <activity android:name="com.tapjoy.TapjoyVideoView" android:configChanges="orientation|keyboardHidden|screenSize" /> <activity android:name="com.tapjoy.TJAdUnitView" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" /> <activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" /> <activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
IMPORTANT: If you’re Publishing and using Proguard add these lines to your configuration file:
To implement the Tapjoy you will need your Tapjoy SDK Key for the application you are integrating. To find this, navigate to your application in the Tapjoy dashboard, and click the "Settings" button on the upper-right:
The SDK Key is the long alphanumeric string at the bottom of this page (if you are publishing to both iOS and Android, you will need both your iOS and Android SDK Keys):
You can set basic configuration using Tapjoy Window. Go to
Window > Tapjoy to open Tapjoy Window.
In Tapjoy Window, you can configure following:
- SDK Key for Android and iOS
- Store name for android market(Google, Amazon, and etc.)
- Enabling or disabling use of Advertising ID, Persistent ID, and IDFA
- Enabling or disabling debug mode (including console logging). Be sure this is disabled for all release builds.
Insert the Tapjoy GameObject only to the scene that appears first in your game.
In the Tapjoy Dashboard, if you click on the "Real-time" tab in the navigation bar on the left, you should see some activity from your application moments after you run it:
Congratulations! You now have Tapjoy working in your application.
TROUBLESHOOTING TIP: Double check the app id and make sure there are no additional whitespace before or after the App ID.
Once you’ve confirmed that your app is integrated correctly, you can go ahead and submit your app to the appropriate App Store. Once the version of your app with our SDK is live:
- Go to your app, and select "User Acquisition" on the left hand side.
- If you have not already done so, click the "Create Ad" button in the upper right to create your ad.
- Find the ad you want to run in the list at the bottom of the screen.
- Click the "Not Approved" status indicator and select “Submit Approval Request” from the drop-down.
- Tapjoy Support Team will verify your integration with the latest build on the market, and will let you know when your app is Tapjoy Enabled. After your app is Tapjoy enabled, you can make this campaign go live by clicking on the ON/OFF switch next to the campaign.