我正在使用Branch.io链接安装回广告活动。我们的设置使用Branch只是为了进行安装属性,之后安装元数据将通过webhook发送回我们的应用程序。我想通过install事件传递一些自定义参数,这样我们就可以将安装绑定到特定用户(在我们自己的系统中,而不是使用Branch的分析)。我最初的想法是调用Branch SDK的setRequestMetaData()
函数,如下所示:
[[Branch getInstance] setRequestMetadataKey: @"userId" value: 123];
问题是我看不到通过webhook发送的安装有效负载中的数据。下面是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
}
有没有其他方法可以通过Branch install事件传递自定义数据?
发布于 2018-06-07 01:32:45
看起来他们支持这个用例。
这是来自他们的文档(参见Track users):
// login
[[Branch getInstance] setIdentity:@"your_user_id"];
// logout
[[Branch getInstance] logout];
请注意,这与GDPR在没有事先用户同意的情况下这样做是背道而驰的,所以如果您在欧洲有用户,他们需要有一个opt-in UI和一个解释。
发布于 2018-06-07 03:48:24
任何请求元数据都应该在顶级JSON字典中,在webhook主体中last_attributed_touch_data
旁边的custom_data
。你是在SDK初始化之前调用setRequestMetadata
吗?确保调用setDebug()
模式时,每个SDK请求都会发送key/values。下面是示例正文:https://docs.branch.io/pages/exports/ua-webhooks/#sample-webhook-post-body-syntax
https://stackoverflow.com/questions/50724752
复制相似问题