How to send ILRD to GameAnalytics
What you’ll need
- GameAnalytics SDK integration set up
- Mediation partner SDK configured and serving ads correctly
How to send ILRD data to GameAnalytics
To capture ILRD from your mediation provider, you will need to add code to your GameAnalytics SDK integration. This varies depending on the SDK version you are using.
info
Refer to the SDK Documentation for code examples specific to your mediation provider and platform (Unity, Unreal, Roblox, iOS, Android, etc.).
AdMob and GameAnalytics’ Unity SDK
To use impression data from AdMob, add the following code inside the OnCreate function of the first activity of your game:
protected void onCreate(Bundle savedInstanceState)
{
//...other code
interstitialAd.setOnPaidEventListener(new OnPaidEventListener()
{
@Override
public void onPaidEvent(AdValue adValue)
{
JSONObject impressionDataJson = new JSONObject();
try
{
impressionDataJson.put("adunit_id", interstitialAd.getAdUnitId());
impressionDataJson.put("currency", adValue.getCurrencyCode());
impressionDataJson.put("precision", adValue.getPrecisionType());
impressionDataJson.put("adunit_format", GameAnalytics.INTERSTITIAL);
impressionDataJson.put("network_class_name", interstitialAd.getResponseInfo().getMediationAdapterClassName());
impressionDataJson.put("revenue", adValue.getValueMicros());
}
catch (JSONException e)
{
e.printStackTrace();
}
GameAnalytics.addImpressionAdMobEvent(MobileAds.getVersionString(), impressionDataJson);
}
Fyber and GameAnalytics’ Unity SDK
void Start ()
{
// ... code
GameAnalyticsILRD.SubscribeFyberImpressions();
}
Ironsource and GameAnalytics’ Unity SDK
void Start ()
{
// ... code
GameAnalyticsILRD.SubscribeIronSourceImpressions();
}
Applovin Max and GameAnalytics’ Unity SDK
void Start ()
{
// ... code
GameAnalyticsILRD.SubscribeMaxImpressions();
}
Topon and GameAnalytics’ Unity SDK
void Start ()
{
// ... code
GameAnalyticsILRD.SubscribeTopOnImpressions();
}