The Tenjin SDK can listen to CAS impression level revenue data and send revenue events to Tenjin. This integration will send revenue related for each ad impression served from CAS. Here are the steps to integrate:
- Add the latest version of CAS SDK to your app-level build.gradle file: https://github.com/cleveradssolutions/CAS-Android/wiki
Please ensure you have the latest CAS Android SDK installed. - Also add the Ad Networks, which you will support (e.g. com.cleveradssolutions:google:22.2.0.2, etc.)
- Integrate CAS SDK in your app. Below is an example of CAS integration.
Java
public class CASActivity extends Activity {
private TenjinSDK tenjinInstance;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cas);
// Initialize Tenjin
tenjinInstance = TenjinSDK.getInstance(こちら, "<Tenjin API Key>");
// Validate Integration
CAS.validateIntegration(こちら);
// Set Ads Settings
CAS.settings.setDebugMode(true);
CAS.settings.setTaggedAudience(Audience.NOT_CHILDREN);
// Initialize SDK
MediationManager adManager = CAS.buildManager()
.withManagerId("demo")
.withAdTypes(AdType.バナー, AdType.Interstitial)
.withTestAdMode(true)
.initialize(こちら);
adManager.setEnabled(AdType.Interstitial, true);
showInterstitial(adManager);
}
private void showInterstitial(MediationManager manager) {
// Create Ad content callback
AdCallback contentCallback = new AdPaidCallback() {
@Override
public void onAdRevenuePaid(@NonNull AdStatusHandler adStatusHandler) {
tenjinInstance.eventAdImpressionCAS(adStatusHandler);
}
// Other AdPaidCallback methods
};
manager.showInterstitial(こちら, contentCallback);
}
}Here is an example impression level revenue data entry from CAS:
| Parameter | Required? | Example |
|---|---|---|
| network_name | いいえ | ネットワーク |
| ad_unit_id | いいえ | id-69082 |
| creative_id | いいえ | id-41203 |
| 収益 | はい | 2 |
| revenue_precision | いいえ | floor |
| format | いいえ | インタースティシャル広告 |