AppLovin MAX Ad Revenue Integration

    AppLovin MAX SDK Installation

    Please refer to the below guide for AppLovin MAX SDK installation.

    AppLovin MAX Ad Revenue SDK to SDK Integration

    Please refer to the below code and send ad revenue data to the Airbridge SDK through the AppLovin MAX SDK's OnAdRevenuePaidEvent callback.

    1234567891011121314151617181920212223242526272829303132333435
    private void OnEnable() {
        MaxSdkCallbacks.Banner.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
        MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
        MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
        MaxSdkCallbacks.RewardedInterstitial.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
        MaxSdkCallbacks.MRec.OnAdRevenuePaidEvent += OnAdRevenuePaidEvent;
    }
    
    private void OnAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
    {
        if (adInfo != null) {
          AirbridgeEvent @event = new AirbridgeEvent("airbridge.adImpression");
    
          var appLovin = new Dictionary<string, object>();
          appLovin["revenue"] = adInfo.Revenue;
          appLovin["country_code"] = MaxSdk.GetSdkConfiguration().CountryCode;
          appLovin["network_name"] = adInfo.NetworkName;
          appLovin["network_placement"] = adInfo.NetworkPlacement;
          appLovin["adunit_identifier"] = adInfo.AdUnitIdentifier;
          appLovin["creative_identifier"] = adInfo.CreativeIdentifier;
          appLovin["placement"] = adInfo.Placement;
    
          var adPartners = new Dictionary<string, object>();
          adPartners["appLovin"] = appLovin;
    
          @event.SetAction(adInfo.NetworkName);
          @event.SetLabel(adInfo.NetworkPlacement);
          @event.SetValue(adInfo.Revenue);
          @event.AddSemanticAttribute("adPartners", adPartners);
          // AppLovin MAX has a default currency of USD
          @event.AddSemanticAttribute("currency", "USD");
    
          AirbridgeUnity.TrackEvent(@event);
        }
    }

    Was this page helpful?

    Have any questions or suggestions?