npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pingansec-vue-ana

v1.1.8

Published

水滴打点

Downloads

9

Readme

pinganana

=======

url链接添加参数自动激活点

=======

安装

1、普通引入,可以使用我们的cdn链接


<script type="text/javascript" src="//staticcdn.shuidi.cn/pa.1.1.js"></script>

或者将dist/pa.min.js 拷到你自己的服务器

2、webpack,vue等项目

npm install pingansec-vue-ana

引入

import PinganAna from 'pingansec-vue-ana'

用法

url链接添加参数自动激活点

https://shuidi.cn/detail-1.html?pa_from=1
javascript动态激活

//普通打点
PinganAna.fire(1);

//ready
PinganAna.ready(function(){  
    

    //条件打点,如果当前页面url存在pa_from=1,激活点22
    PinganAna.hasParent(1).fire(22);
    
    //如果pa_from=1这个参数存在,将它设置一个可以做为类型条件的点
    PinganAna.hasParent(1).setType('sms');


    //设置sms类型可做为条件的点1,激活点1
    PinganAna.type('sms').fire(1);

    //如果点1曾经被激活,那么激活点2
    PinganAna.type('sms').hasParent(1).fire(2);
    
    //如果点1被激活,那么激活点2,并将2设置为sms2类型可被作为条件的点
    PinganAna.type('sms').hasParent(1).type('sms2').fire(2)
    
    //可以自己指定guid来计算uv,比如使用user_id,这样计算出来的uv更加准确
    PinganAna.fire(1,"123");
    
    //激活点111,之后111点无法再被激活,可用于消费统计,新增统计等特殊场景
    PinganAna.fireForever(111);

     /**
             *
             * @param position  位置
             * @param group  组合
             * @param from  [从哪里来,爱查,水滴]
             * @param uid  [用户id,,或者user_id]
             * @param did  [关联数据id,digest]
             * @param guid  [用户guid,小程序,等独立个体需要传,普通pc项目,vue项目无需传]
             */
    PinganAna.userClickLog(position,group,from,uid,did,guid);


    //自动追踪,自动生成点和组
    PinganAna.autoTrack(name,group,guid);


    //vue中增加一个全局的页面监控
    router.beforeEach(function (to,fromm,next) {
        
        if (to.path && to.matched && to.matched.length>0) {
            PinganAna.ready(function () {
                let pageName = to.matched[to.matched.length-1].path;
                PinganAna.autoTrack(pageName);
            });
        }
    });

});