网页埋点说明
一、配置环境
1、获取JS 代码(示例)
信息
路径:【连接管理】>选择已新建的自定义连接>【JS SDK接入】>【追踪代码】



注:勾选页面离开事件以及开启非静默授权会影响url的参数拼接,按实际业务要求勾选
2、调用JS代码

setup只能被调用1次。
A. SDK实例的setup方法调用
信息
linkflow.setup({ name: 'xxx', token: 'xxx', cid_type: 'xxx', server_url: 'xxx', _id_share: false, wechat_auth: { appid: 'appid', scope: 'snsapi_userinfo' }, auto_track: { page_show: true, page_leave: true, page_leave_max_duration: 300 } });
B. linkflow.min.js 的脚本参数
信息
<!DOCTYPE html>
<html>
<head>
<!-- 追踪代码: -->
<script src="//sdk.linkflowtech.com/linkflow.min.js?token=xxx&server_url=xxx&name=xxx&appid=xxx&scope=snsapi_userinfo&atrk_pl=1&atrk_pl_mxd=300&cidt='xxx'&_id_share=0"></script>
</head>
<body></body>
</html>
| 参数 | 类型 | 是否必填 | 配置来源 | 说明 |
|---|---|---|---|---|
| token | string | 是 | A, B: token | 用于识别埋点渠道 |
| server_url | string | 是 | A, B: server_url | 埋点数据收集的后端服务器地址,默认为 https://cdp.linkflowtech.com |
| name | string | 否 | A, B: name | SDK 使用的一个默认的全局变量名,会注册在 App 全局函数中 |
| cid_type | string | 否 | A, B: cidt | |
| _id_share | boolean | 否 | A, B: _id_share | 控制是否读取页面url中的query参数中的_If_ids |
| wechat_auth | Object | 否 | 如果页面和微信公众号关联,和公众号授权相关的设置 | |
| appid | string | 否 | A, B: appid |