筛选项

获取 Branch 的最后归因触点数据

概述

Branch 包含 SDK 方法,以允许从客户端检索我们的最后归因触点数据(LATD)。这将导致对 Branch 的服务器进行异步调用,并可能返回 LATD 数据。

最后归因触点数据包含与该用户的上次查看展示或点击链接相关的信息。

返回的字段

通过使用 LATD SDK 查询,以下字段将返回给客户端:

  • last_attributed_touch_type
  • last_attributed_touch_timestamp
  • last_attributed_touch_data_tilde_id
  • last_attributed_touch_data_tilde_campaign
  • last_attributed_touch_data_tilde_campaign_id
  • last_attributed_touch_data_tilde_campaign_type
  • last_attributed_touch_data_tilde_customer_campaign
  • last_attributed_touch_data_tilde_channel
  • last_attributed_touch_data_tilde_feature
  • last_attributed_touch_data_tilde_stage
  • last_attributed_touch_data_tilde_tags
  • last_attributed_touch_data_tilde_advertising_partner_name
  • last_attributed_touch_data_tilde_advertising_partner_id
  • last_attributed_touch_data_tilde_secondary_publisher
  • last_attributed_touch_data_tilde_secondary_publisher_id
  • last_attributed_touch_data_tilde_customer_secondary_publisher
  • last_attributed_touch_data_tilde_creative_name
  • last_attributed_touch_data_tilde_creative_id
  • last_attributed_touch_data_tilde_ad_set_name
  • last_attributed_touch_data_tilde_ad_set_id
  • last_attributed_touch_data_tilde_customer_ad_set_name
  • last_attributed_touch_data_tilde_ad_name
  • last_attributed_touch_data_tilde_ad_id
  • last_attributed_touch_data_tilde_customer_ad_name
  • last_attributed_touch_data_tilde_keyword
  • last_attributed_touch_data_tilde_keyword_id
  • last_attributed_touch_data_tilde_customer_keyword
  • last_attributed_touch_data_tilde_sub_site_name
  • last_attributed_touch_data_tilde_customer_sub_site_name
  • last_attributed_touch_data_tilde_branch_ad_format
  • last_attributed_touch_data_tilde_technology_partner
  • last_attributed_touch_data_tilde_banner_dimensions
  • last_attributed_touch_data_tilde_placement
  • last_attributed_touch_data_tilde_placement_id
  • last_attributed_touch_data_tilde_customer_placement
  • last_attributed_touch_data_tilde_agency
  • last_attributed_touch_data_tilde_agency_id
  • last_attributed_touch_data_tilde_tune_publisher_name
  • last_attributed_touch_data_tilde_tune_publisher_id
  • last_attributed_touch_data_tilde_tune_publisher_sub1
  • last_attributed_touch_data_tilde_tune_publisher_sub2
  • last_attributed_touch_data_tilde_tune_publisher_sub3
  • last_attributed_touch_data_tilde_tune_publisher_sub4
  • last_attributed_touch_data_tilde_tune_publisher_sub5
  • last_attributed_touch_data_tilde_optimization_model
  • last_attributed_touch_data_tilde_secondary_ad_format
  • last_attributed_touch_data_tilde_external_touch_id
  • last_attributed_touch_data_tilde_journey_id
  • last_attributed_touch_data_tilde_journey_name
  • last_attributed_touch_data_tilde_view_id
  • last_attributed_touch_data_tilde_view_name
  • last_attributed_touch_data_plus_referring_domain
  • last_attributed_touch_data_plus_current_feature
  • last_attributed_touch_data_plus_via_features
  • last_attributed_touch_data_dollar_3p
  • last_attributed_touch_data_dollar_fb_data_terms_not_signed
  • last_attributed_touch_data_plus_web_format
  • last_attributed_touch_data_plus_touch_id
  • last_attributed_touch_data_custom_fields

启用 LATD 功能

必须先在 Branch 操作后台 (Dashboard)中启用此功能,然后才能在客户端接收 Branch 的最后一个归因触点数据。默认情况下此功能不会被启用。

要启用 LATD:

  1. In the left-hand navigation, click on Link Settings.
  2. On the Link Settings page, scroll down and expand Advanced Settings.
  3. Within the Advanced Settings section, check the box next to Enable retrieving Last Attributed Touch Data via SDKs.
  4. Once checked, scroll down to the bottom of the page and click Save.
2314

必要的 SDK 方法

🚧

用于自归因平台的 LATD

该 endpoint 从我们的 Persona (同人用户)商店中读取最后的归因触点数据。如果您在会话开始后立即调用它,则它可能不包含最新的归因数据。对自归因广告平台(SAN)(如 Facebook 和 Google)的请求将以异步方式处理,并且需要一些时间才能完成。

Android

📘

归因窗口逻辑

When calling the LATD method, you can also provide a value for the attributionWindow you want applied to the data. If you do not provide a value within the SDK, Branch will use the attribution window setting value in your Branch dashboard.

// init the LATD call from inside the session initialization callback
Branch.getInstance().getLastAttributedTouchData(
    new BranchLastAttributedTouchDataListener() {
        @Override
        public void onDataFetched(JSONObject jsonObject, BranchError error) {
             // read the data from the jsonObject
        }
    }, attributionWindow);

iOS

📘

归因窗口逻辑

When calling the LATD method, you can also provide a value for the attributionWindow you want applied to the data. If you do not provide a value within the SDK, Branch will use the attribution window setting value in your Branch dashboard.

[[Branch getInstance] lastAttributedTouchDataWithAttributionWindow:0 completion:^(BranchLastAttributedTouchData * _Nullable latd, NSError * _Nullable error) {
// access the data through latd.lastAttributedTouchJSON;
}];
Branch.getInstance().lastAttributedTouchData(withAttributionWindow: 0) { latd, error in
// access the data through latd?.lastAttributedTouchJSON
}

Web

📘

归因窗口逻辑

When calling the LATD method, you can also provide a value for the attribution_window you want applied to the data. If you do not provide a value within the SDK, Branch will use the attribution window setting value in your Branch dashboard.

branch.lastAttributedTouchData(
    attribution_window,
    callback (err, data)
);

React Native

📘

归因窗口逻辑

When calling the LATD method, you can also provide a value for the attributionWindow you want applied to the data. If you do not provide a value within the SDK, Branch will use the attribution window setting value in your Branch dashboard.

const attributionWindow = 365;
const latData = await branch.lastAttributedTouchData(attributionWindow);
// latData is an Object