You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

sensor-tracker

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sensor-tracker

sensor-sdk的封装

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

使用

根据神策官方文档你需要传递这些参数

config

// config配置
const config = {
  sdk_url: 'xxx',
  name: 'xxx',
  server_url: 'xxx',
  config_url: 'xxx',
  vtrack_js_file: 'xxx',
  vtrack_css_file: 'xxx',
  web_url: 'xxx',
  heatmap: {}
}

公共事件属性(commonAttr)

// 支持公共事件属性
const commonAttr={
  name:"xxx",
  age:"xxx"
}

关于JWT

❗️我们需要你的JWT信息内包含oid字段,可让后端支持

// 需要你传入获取JWT数据的方法

function getJWT(){
  
}

具体使用

trackerLoaded会返回一个函数,你可以选择把这个函数挂载到window上

👉关于神策埋点方案


window.sensor=trackerLoaded(config,commonAttr,getJWT)



window.sensors.tracks('ButtonClick', {
  Button0: 'GiftAdressSubmit',
  ProductCatalog: 'Laptop Computer',
  ProductName: 'MacBook Pro',
  ProductPrice: 123.45
})


Keywords

sensor

FAQs

Package last updated on 14 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts