Unity SDK 集成 如果您想使用 Unity SDK 监测广告收入,可以借助 SDK 到 SDK 集成,将数据发送到 Adjust 服务器。 操作前须知 要使用该功能,请先为您的应用下载并设置对应的 Adjust Unity SDK。 要了解更多信息,请查看 Unity Mediation API和展示事件文档。 示例 1static void OnImpression(object sender, ImpressionEventArgs e)2{3 var impressionData = e.ImpressionData != null ? JsonUtility.ToJson(e.ImpressionData, true) : "null";4 Debug.Log($"Impression event from ad unit id {e.AdUnitId} : {impressionData}");5 6 // send impression data to Adjust7 if (e.ImpressionData != null)8 {9 AdjustAdRevenue adjustAdRevenue = new AdjustAdRevenue("unity_sdk");10 adjustAdRevenue.SetRevenue(e.ImpressionData.PublisherRevenuePerImpression, e.ImpressionData.Currency);11 // optional fields12 adjustAdRevenue.AdRevenueNetwork = e.ImpressionData.AdSourceName;13 adjustAdRevenue.AdRevenueUnit = e.ImpressionData.AdUnitId;14 adjustAdRevenue.AdRevenuePlacement = e.ImpressionData.AdSourceInstance;15 // Send Adjust ad revenue16 Adjust.TrackAdRevenue(adjustAdRevenue);17 }18}