Skip to content

Send exposed ad info

Sending ad revenue and exposure information

When ads are displayed in the game, you can measure the type of ad platform, ad display location, timing of exposure, revenue per ad exposure, etc., and send this information to third-party attribution. To send this ad revenue and exposure information, call the sendAdRevenueEvent() function of the Analytics API. Below is an example code for sending ad exposure information to marketing attribution.

Note

If you are using Hive Adiz or Hive AdKit for AD(X), the advertising revenue module automatically sends ad revenue and exposure information, so you do not need to call the sendAdRevenueEvent() function additionally.

// Send ad sales measurement event to third-party attribution
AnalyticsAdRevenue analyticsAdRevenue = new AnalyticsAdRevenue();
analyticsAdRevenue.revenue = 3.0; // advertising revenue
analyticsAdRevenue.adPlatform = "AD Platform"; // ad network platform name
analyticsAdRevenue.adUnitId = "Test Unit Id"; // ad unit ID
analyticsAdRevenue.adType = "RewardedAD"; // Ad exposure type
analyticsAdRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location
analyticsAdRevenue.currency = "USD"; //currency code (ISO 4217 standard) 

Analytics.sendAdRevenueEvent(analyticsAdRevenue);
#include "HiveAnalytics.h"

FHiveAnalyticsAdRevenue AdRevenue;
AdRevenue.Revenue = 3.0; // Ad revenue
AdRevenue.AdPlatform = TEXT("AD Platform"); // Ad network platform name
AdRevenue.AdUnitId = TEXT("Test Unit Id"); // Ad unit ID
AdRevenue.AdType = TEXT("RewardedAD"); // Ad exposure type
AdRevenue.AdPlacement = TEXT("Test Rewarded AD"); // Ad exposure location
AdRevenue.Currency = TEXT("USD"); // Currency code (ISO 4217 standard) 

FHiveAnalytics::SendAdRevenueEvent(AdRevenue);
// Send ad sales measurement event to third-party attribution
AnalyticsAdRevenue analyticsAdRevenue;
analyticsAdRevenue.revenue = 3.0; // advertising revenue
analyticsAdRevenue.adPlatform = "AD Platform"; // ad network platform name
analyticsAdRevenue.adUnitId = "Test unit id"; // ad unit ID
analyticsAdRevenue.adType = "RewardedAD"; // Ad exposure type
analyticsAdRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location
analyticsAdRevenue.currency = "USD"; //currency code (ISO 4217 standard)

Analytics::sendAdRevenueEvent(analyticsAdRevenue);
// Send ad sales measurement event to third-party attribution
AnalyticsImpl.AnalyticsAdRevenue analyticsAdRevenue = new AnalyticsImpl.AnalyticsAdRevenue();
analyticsAdRevenue.setRevenue(3.0); // advertising revenue
analyticsAdRevenue.setAdPlatform("AD Platform"); // ad network platform name
analyticsAdRevenue.setAdUnitId("Test Unit Id"); // ad unit ID
analyticsAdRevenue.setAdType("RewardedAD"); // Ad exposure type
analyticsAdRevenue.setAdPlacement("Test Rewarded AD"); // Ad exposure location
analyticsAdRevenue.setCurrency("USD"); //currency code (ISO 4217 standard) 

com.hive.Analytics.INSTANCE.sendAdRevenueEvent(analyticsAdRevenue);
// Send ad sales measurement event to third-party attribution
var analyticsAdRevenue: AnalyticsImpl.AnalyticsAdRevenue = AnalyticsImpl.AnalyticsAdRevenue()
analyticsAdRevenue.revenue = 3.0 // advertising revenue
analyticsAdRevenue.adPlatform = "AD Platform" // Ad network platform name
analyticsAdRevenue.adUnitId = "Test Unit Id" // Ad unit ID
analyticsAdRevenue.adType = "RewardedAD" // Ad exposure type
analyticsAdRevenue.adPlacement = "Test Rewarded AD" // Ad exposure position
analyticsAdRevenue.currency = "USD" // Currency code (ISO 4217 standard) 

Analytics.sendAdRevenueEvent(analyticsAdRevenue)
// Send ad sales measurement event to third-party attribution
HIVEAnalyticsAdRevenue* adRevenue = [[HIVEAnalyticsAdRevenue alloc] init];
adRevenue.revenue = 3.0; // advertising revenue
adRevenue.adPlatform = "AD Platform"; // ad network platform name
adRevenue.adUnitId = "Test Unit Id"; // ad unit ID
adRevenue.adType = "RewardedAD"; // Ad exposure type
adRevenue.adPlacement = "Test Rewarded AD"; // Ad exposure location
adRevenue.currency = ""; //currency code (ISO 4217 standard)

[HIVEAnalytics sendAdRevenueEvent:adRevenue];
// Send ad sales measurement event to third-party attribution
let analyticsAdRevenue = AnalyticsAdRevenue()
analyticsAdRevenue.revenue = 3.0 // advertising revenue
analyticsAdRevenue.adPlatform = "AD Platform" // Ad network platform name
analyticsAdRevenue.adUnitId = "AD Unit Id" // Ad unit ID
analyticsAdRevenue.adType = "AD Type" // Ad exposure type
analyticsAdRevenue.adPlacement = "AD Placement" // Ad placement location
analyticsAdRevenue.currency = "USD" // Currency code (ISO 4217 standard)

AnalyticsInterface.sendAdRevenueEvent(analyticsAdRevenue)

Ad exposure information

The information sent to third-party mobile app attribution when transmitting ad exposure information is as follows.

  Airbridge Adjust Singular AppsFlyer Firebase Analytics
PARAMETER
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Ad Type
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Ad Type
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id
  • Ad Placement
  • Ad Type
  • Revenue
  • Currency
  • Ad Platform
  • Ad Unit Id (Ad Unit Name)
  • Ad Type (Ad Format)
  • Revenue (Value)
  • Currency