筛选项

MoPub 展示级别收入数据

📘

注意

Please contact your MoPub account representative to have this feature enabled in your account.

概述

MoPub 的 Impression-Level Revenue Data(ILRD,即展示级别收入数据)解决方案使发行商能够利用数据更好地了解用户,并通过提供以下好处优化付费获客:

  • 在展示级别访问用户收入数据:触发广告展示后实时获得收入数据;包括许多其他数据字段,例如需求来源,广告展示位置,货币和国家/地区信息。

  • 明确收入精确度:指示收入是否准确或估计的标记,为发行商提供对数据更多的可观性。

  • 数据提取和处理的灵活性 :自己处理数据或将其发送给第三方合作伙伴以进行更深入的分析和报告。

通过完成以下操作,您可在 Branch 操作后台 (Dashboard)把 MoPub 展示级别收入数据作为 “Purchase” commerce 事件来查看,以进行进一步的分析和导出。

!!!信息“注意事项”
—根据您的流量,Volume 可能会很大。如果您有任何疑问,请联系您的客户经理以获取更多详细信息。

- If you already recording purchase commerce events, you can create a custom event with custom data to track the ILRD from MoPub instead by editing the code snippets below.

要求

  • 请联系 MoPub 客户代表以在您的帐户中启用此功能。
  • MoPub SDK 5.7.0
  • 应用中实现的 Branch 特定侦听器代码
  • 使用 v2事件的 Branch SDK
    —iOS SDK v0.21.9 +
    —Android SDK v2.14 +

Branch 特定侦听器代码示例

为了使 Branch 能够从 MoPub 接收展示级别收入数据,您必须在应用中包含侦听器,才能将这些数据发送给 Branch。在应用中实现侦听器时,请使用下面引用的代码示例。

Please refer to MoPub’s developer documentation for more detail.

Android 代码

MoPub SDK v5.7.0 and above has the public interface, ImpressionListener. This listener is notified when an impression is fired for any format of ad shown.

protected void trackMoPubImpression(ImpressionData impression) {
        BranchEvent event = new BranchEvent(BRANCH_STANDARD_EVENT.PURCHASE);
        event.setRevenue(impression.getPublisherRevenue());
        event.setDescription(impression.getAdGroupType());


        String precision = impression.getPrecision();
        String json = impression.getJsonRepresentation().toString();
        String encodedJson = Base64.encodeToString(json.getBytes(), Base64.DEFAULT);

        event.addCustomDataProperty("precision", precision);
        event.addCustomDataProperty("mopub_ad_information", encodedJson);

        // modify with appropriate context
        event.logEvent(getApplicationContext());
    }

iOS 代码

There are two approaches to receive Impression data, one is register to NSNotificationCenter to receive impression data and the other approach is to set the impression callback delegate which is the most convenient way for publishers to receive callback for every impression.

A unified ad delegate is used by all formats except for rewarded video, which uses MPRewardedVideoDelegate

- (void)trackMoPubImpression:(MPImpressionData *)data {

    BranchEvent *event = [BranchEvent standardEvent:BranchStandardEventPurchase];
    event.revenue = [NSDecimalNumber decimalNumberWithDecimal:[data.publisherRevenue decimalValue]];
    event.eventDescription = data.adGroupType;

    NSString *precision = [NSNumber numberWithInteger:data.precision].stringValue;
    NSString *json = [data.jsonRepresentation base64EncodedStringWithOptions:0];
    if (json && precision) {
        event.customData = (NSMutableDictionary *) @{ @"precision": precision, @"mopub_ad_information": json };
    }
    [event logEvent];
}

MoPub < >Branch 数据映射

MoPub 参数Branch PURCHASE 参数
publisher_revenuerevenue
precisioncustom_data.precision
adgroup_typeeventDescription
[entire JSON blob]custom_data.mopub_ad_information

ILRD 报告与导出

当 MoPub 展示级别收入数据作为标准 purchase commerce 事件导入:

  • 收入值在广告分析和 Cohort(同期群)报告中提供。

  • Postback 和 Export 包括 MoPob 在 Branch custom_data 中为 PURCHASE commerce 事件提供的整个 JSON blob。

  • 注意:收入值是 base64编码 string。