首页 文章

Branch.io通过安装传递自定义数据

提问于
浏览
0

我正在使用Branch.io将安装链接回广告系列 . 我们的设置仅使用Branch进行安装归因,然后安装元数据通过webhook发送回我们的应用程序 . 我想通过安装事件传递一些自定义参数,以便我们可以将安装绑定到特定用户(在我们自己的系统中,而不是像这样使用Branch 's analytics). My initial thought was to make a call to Branch SDK' s setRequestMetaData() 函数:

[[Branch getInstance] setRequestMetadataKey: @"userId" value: 123];

问题是我没有在通过webhook发送的Install有效负载中看到这些数据 . 这是webhook有效负载的样子:

{
    "name":  "INSTALL",
    "user_data":  {
        "os": "IOS",
        "os_version": "11.4",
        "environment": "FULL_APP",
        "platform": "IOS_APP",
        "idfv": "masked",
        "limit_ad_tracking": false,
        "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML,
         like Gecko) Mobile/15F79",
        "ip": "xxx.xx.xx.xx",
        "country": "US",
        "language": "EN",
        "sdk_version": "0.25.0",
        "app_version": "2.6.3",
        "brand": "Apple",
        "model": "iPhone7,2",
        "geo_dma_code": 501,
        "geo_country_code": "US"
    },
    "last_attributed_touch_data":  {
        "~feature": "marketing",
        "~id": 464580903277040904,
        "~campaign": "test-campaign",
        "~channel": "Facebook",
        "+url": "https: //subdomain.test-app.link/branch-test",
        "$desktop_url": "http: //www.sample.com",
        "$marketing_title": "Test Link",
        "~creation_source": 1,
        "~marketing": true,
        "+click_timestamp": 1528297685,
        "$one_time_use": false,
        "$android_url": "http: //www.sample.com",
        "$ios_passive_deepview": "branch_passive_default",
        "testTag": "testValue",
        "~tags": [
            "123"
        ],
        "+via_features": [
            "QUICK_LINKS"
        ]
    },
    "timestamp":  1528297898204
}

是否有另一种方法可以通过分支安装事件传递自定义数据?

2 回答

  • 0

    看起来他们支持该用例 .

    这是来自他们的文档(见Track users):

    // login
    [[Branch getInstance] setIdentity:@"your_user_id"];
    
    // logout
    [[Branch getInstance] logout];
    

    请注意,未经用户事先同意,这是针对GDPR执行此操作的,因此如果您在欧洲有用户,则需要具有选择加入的用户界面和说明 .

  • 0

    任何请求元数据都应该位于webhook正文中 last_attributed_touch_data 旁边的顶级JSON字典中 . 你是在SDK初始化之前调用 setRequestMetadata 吗?确保在调用 setDebug() mode时,在每个SDK请求上发送键/值 . 这是示例正文:https://docs.branch.io/pages/exports/ua-webhooks/#sample-webhook-post-body-syntax

相关问题