在使用该文档前请联系兔展 生态合作中心负责人
方法一:通过URL传入客户身份识别的
使用方法:
- 作品链接上加previewer=mp和userInfo这两个参数;
- 在userInfo参数中传入平台标识和身份信息;
previewer字段说明
表明访问环境,支持的参数值有:mp、app。
- 当参数值为mp,表示小程序环境当参数值为mp,表示mini-program环境
- 当参数值为app,表示App环境
用户务必留意自己活动投放的环境。
注意:为防止作品本身发生默认的公众号授权,除字段 mp_userinfo & app_id 外任何时候
都必须要传递 stopAuth=1&previewer=mp 或者 stopAuth=1&previewer=app 来阻止默认的公众号授权以及标明此作品访问环境为mini-program环境或者APP环境
userInfo字段说明
字段 | 类型 | 描述 |
userInfo | object | 身份信息 |
identitys | object[] | 多组身份信息 , |
最大支持5组身份信息 | ||
identityType | string | 身份类型:openid=微信环境下的openid、unionid=微信环境下的unionid,fans_id=有赞商城识别id,支持自定义类型标识 |
identityValue | string | 身份类型对应的id取值 |
mpid | string | 微信公众号appid或小程序appid或自建应用id等 |
platform | string |
平台标识,标记客户身份来源,兔展工作台企业->数据集成->自建应用->应用ID,仅支持审核通过的应用
平台标识,gzh(微信公众号)、contentminiapp(微信小程序)、EXTERNAL(自建应用) | ||
isWeChatEcosystem | boolean | 是否微信生态,true是 false否 |
说明:若需要传入自定义客户身份,则platform和identitys字段均为必填项说明:identitys必需且至少一组身份数据,否则建档失败。identityType的取值为“工作台”->“用户”->“用户身份管理”中的”用户身份id“配置。
数据结构:
注:全平台通用身份只需要传 identityValue、identityType
代码块 | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "userInfo": { "identitys": [ { "identityType":"openid", "identityValue":"openid-xxxx-xxxxx-xxxxx-xxxxx", "mpid":"wxappid", "identityValueplatform":"gzh", "isWeChatEcosystem":true }, { "identityType":"unionid", "identityValue":"unionid-xxxx-xxxxx-xxxxx-xxxxx", "identityValue": ""mpid":"wxappid", "platform":"gzh", "isWeChatEcosystem":true }, { "identityType":"user_id", // 身份类型标识,全局唯一用户ID标识建议用 user_id 。自定义身份字段名需要优先在 兔展 用户-身份字段管理中新增配置后才能正常使用 "identityValue":"user_id-xxxx-xxxxx-xxxxx-xxxxx", "identityValuempid":"应用id", "isWeChatEcosystem":false }, ]{ "identityType":"phone", "platform "identityValue": "188xxxxxxxx" } ] } } |
如果有其它的用户信息,也可以附加在userInfo内进行上报,例如预设的头像(headimgurl)、昵称(nickname)、性别(sex)等。
customFields为用户信息扩展字段,以对象数组的形式支持传入多条数据,其中fieldValue为字符串数组类型,可传入多条数据,
fieldId为“工作台”→“用户”→“字段管理”中的”字段id“的配置,
fieldKey为“工作台”->"用户“->“字段管理”中的“字段英文名”.如果有其它的身份信息,也可以附加在userInfo内进行上报,例如微信环境下
代码块 | ||||
---|---|---|---|---|
| ||||
{ "userInfo": { "identitys": [ { "identityType":"openid", "identityValue":"openid-xxxx-xxxxx-xxxxx-xxxxx", "mpid":"wxappid", "platform":"gzh", "isWeChatEcosystem":true }, { "identityType":"unionid", "identityValue":"unionid-xxxx-xxxxx-xxxxx-xxxxx", "mpid":"wxappid", "platform":"gzh", "isWeChatEcosystem":true }, { "identityType":"user_id", // 身份类型标识,全局唯一用户ID标识建议用 user_id 。自定义身份字段名需要优先在 兔展 用户-身份字段管理中新增配置后才能正常使用 "identityValue":"user_id-xxxx-xxxxx-xxxxx-xxxxx", "mpid":"应用id", "isWeChatEcosystem":false }, { ] "identityType":"phone", "platformidentityValue": "wx"188xxxxxxxx" } ], "nickname": "xxxx", "headimgurl": "xxxx", "sex": "0", "customFields": [ { "unionid "fieldValue": ["",""], "fieldId": xxx,(已弃用,20230203) "fieldKey": "xxxx-xxxx-xxxx-xxxxx" }, ] } } |
url地址带参示范
访问转换后url地址,验证上报参数
- 注意:
1、identitys是识别用户的标识,比如身份证号、手机号、会员卡号等;而customFields传入的是用户的属性,如职业、行业、岗位等,这些数据在校验通过后,都会落库存储。
2、若只需要在url中透传,无需持久化到兔展侧进行存储,则可以通过拼接extField参数来实现。
拼接 extField 的字段值时 需要对字段值进行一次转义操作 encodeURIComponent (JSON.stringify(第三方要传入的对象值))
示例:
|
方法二:通过斐波SDK传入客户身份识别的数据
具体查看文档:H5-SDK