Record ad impression events
Record when players view ads in your game to track ad revenue and measure advertising performance.
阅读时间2 分钟最后更新于 10 个月前
Use the event to track what happens when you show an ad to a player.
adImpressionSend events manually
The event is a standard event with a predefined schema you must match to process and track the event. A special object is provided by the Analytics SDK to fulfil the schema when recording an ad impression.
adImpressionAdImpressionParametersUse the following code to record a minimal event:
adImpressionpublic void RecordAdImpression(){ var adImpression = new AdImpressionParameters { AdProvider = AdProvider.UnityAds, AdCompletionStatus = AdCompletionStatus.Completed, AdEcpmUsd = 12.34, AdStoreDstID = "CoolStore1337", PlacementID = "PLACEMENTID", PlacementName = "PLACEMENTNAME", PlacementType = AdPlacementType.BANNER }; AnalyticsService.Instance.AdImpression(adImpression);}
Some of these fields need to be populated with values that come from your ad mediation SDK, while others are specific to your game. See the breakdown:
|
|
|---|---|
AdProvider | The ad network name or ID that served the ad, for example, UNITY, IRONSOURCE. This value is often passed on a per-impression level by your mediation provider or ad network. You might need to map it to a value in the enum. |
AdCompletionStatus | If the user watched the entire ad (COMPLETED), part of the ad (PARTIAL), or none of the ad (INCOMPLETE). Most applicable for interstitial ads which can be skipped by players. |
AdEcpmUsd | eCPM ("effective Cost Per Mille": the revenue generated by 1000 impressions) in US Dollars. This value is often passed on a per-impression level by your mediation provider or ad network and used in ad LTV calculations. Populate this value if possible. |
AdStoreDstID | The store the player is directed to after cliking the ad, for example, Google Play, App Store, Amazon. |
PlacementID | The unique identifier for the placement as integrated in the game. |
PlacementName | The name of the placement as integrated in the game, for example, "Boosters" or "Daily Reward". This correlates with the placement name configured in your ad network or mediation provider. |
PlacementType | Indicates what type of ad is shown, for example, REWARDED, INTERSTITIAL or BANNER. |
The object contains a number of other fields that are less important, which you can also populate if you want.
AdImpressionParameters