bury-com

A common bury module

Usage no npm install needed!

<script type="module">
  import buryCom from 'https://cdn.skypack.dev/bury-com';
</script>

README

bury-com

Introduction

`bury-com` is a common bury module for 58 HRG .

For more infomation , See (here)[https://github.com/liuding-Jason/bury-com]

Install

npm install bury-com --save

How to use

bury utils

`bury-com` would always be a common function , so it should be instanced in `utils` .
When used this moudle , you should do as bellow :

bury/index.js

import { Bury } from "bury-com" ;
import Logs from "./log" ;

// init 
const buryInstance = new Bury(Logs) ;

const bury = (type = "") => {
    type && buryInstance.bury.call(buryInstance , type) ;
} ;

module.exports = bury ;

bury/log.js

`bury-com` module could support all three different appearance , app 、mobile and pc .
when used on app , you should set your log as bellow : 
let pagetype = 'page' ;
let Logs = {
    'test_index_show' : {
        pagetype ,
        actiontype : 'page_show' ,
        opt : {}
    } ,
    'home_click' : {
        pagetype ,
        actiontype : 'page_click' ,
        opt : {}
    }
} ;

module.exports = Logs ;
And when used on mobile browser and pc , the settings should be :
let Logs = {
    'test_index_show' : {
        from : 'home_page_show' ,
        opt : {}
    } ,
    'home_click' : {
        from : 'home_page_click' ,
        opt : {}
    }
} ; 

module.exports = Logs ;

LINCESE

MIT