adjust-icon

Unity SDK integration

If you want to measure ad revenue with the Unity SDK, you can use the SDK-to-SDK integration to pass this information to Adjust’s servers.

Before you begin

To use this feature, you first need to download and set up the Adjust Android SDK for your app.

For more information, see the Unity Mediation API and impression events documentation.

Example

// implement an impression listener
final IImpressionListener impressionListener = new IImpressionListener() {
@Override
public void onImpression(@NonNull String adUnitId, @Nullable ImpressionData impressionData) {
// send impression data to Adjust
AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue("unity_sdk");
adjustAdRevenue.setRevenue(impressionData.getPublisherRevenuePerImpression(), impressionData.getCurrency());
// optional fields
adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdSourceName());
adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnitId());
adjustAdRevenue.setAdRevenuePlacement(impressionData.getAdSourceInstance());
// Send Adjust ad revenue
Adjust.trackAdRevenue(adjustAdRevenue);
}
};
// subscribe the impression listener to the impression event publisher
ImpressionEventPublisher.subscribe(impressionListener);
// unsubscribe the impression listener from the impression event publisher
ImpressionEventPublisher.unsubscribe(impressionListener);