Unity SDK 集成 如果您想使用 Unity SDK 监测广告收入,可以借助 SDK 到 SDK 集成,将数据发送到 Adjust 服务器。 操作前须知 要使用该功能,请先为您的应用下载并设置对应的 Adjust 安卓 SDK。 要了解更多信息,请查看 Unity Mediation API和展示事件文档。 示例 1// implement an impression listener2final IImpressionListener impressionListener = new IImpressionListener() {3 @Override4 public void onImpression(@NonNull String adUnitId, @Nullable ImpressionData impressionData) {5 // send impression data to Adjust6 AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue("unity_sdk");7 adjustAdRevenue.setRevenue(impressionData.getPublisherRevenuePerImpression(), impressionData.getCurrency());8 // optional fields9 adjustAdRevenue.setAdRevenueNetwork(impressionData.getAdSourceName());10 adjustAdRevenue.setAdRevenueUnit(impressionData.getAdUnitId());11 adjustAdRevenue.setAdRevenuePlacement(impressionData.getAdSourceInstance());12 // Send Adjust ad revenue13 Adjust.trackAdRevenue(adjustAdRevenue);14 }15};16 17// subscribe the impression listener to the impression event publisher18ImpressionEventPublisher.subscribe(impressionListener);19 20// unsubscribe the impression listener from the impression event publisher21ImpressionEventPublisher.unsubscribe(impressionListener);