🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

if-wolftrack

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

if-wolftrack

埋点程序

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

WolfTrack

原名wolf-logger 更名为wolf-track

Deps 依赖

if-ua, if-spm

window.WolfConfig

在调用程序前请先配置该设置

window.WolfConfig = {
    spm: { a: "default", b: "main" },
    pv: {
      where_to_sendpv: "//xiaoheizhang.cn/prod.gif",
      where_to_record: '//127.0.0.1/a.gif',
      PV_TO_URLS: [
        ["127.0.0.1", "local"],
        ["localhost", "local"],
        ["dev", "dev"],
        ["test", "test"],
        ["uat", "uat"],
      ],
    },
}

简单配置即可使用

<script>
  var SITE_APP_ID = 'P011'
  var LOGSITE = '埋点数据接收地址'
  var WolfConfig = { spm: { a: SITE_APP_ID, b: "main" }, pv: { p_id: SITE_APP_ID, application: '4', where_to_sendpv: LOGSITE[0]}, is_auto_pv: true, spa: true };
  (function () {
    var wf = document.createElement("script");
    wf.src = "//if-fe-assets.oss-cn-beijing.aliyuncs.com/pkg/if-wolftrack/1.0.2/if-wolftrack.js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(wf, s);
  })();
</script>

window.WolfTrack

初始化

const wolf = new WolfTrack()

sendPV

发送PV信息

const config = {
    method: 'POST'
}, data = {foo: 'Hi,World'}
wolf.sendPV(config, data)

record

主动上报

const data = {foo: 'Hi,World'}
wolf.record(data)

版本

  • 1.0.4 PV字段支持动态获取(函数)
  • 1.0.3 移除了FingerPrint指纹算法,使用了更为简单高效的uuid的算法,打包后体积45KB

Keywords

WolfTrack

FAQs

Package last updated on 12 Oct 2023

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