jctrans-track-report
TypeScript icon, indicating that this package has built-in type declarations

0.0.11 • Public • Published

jctrans-report

How to use

  1. Install Node.js

  2. Install dependencies: npm install jctrans-track-report or pnpm install jctrans-track-report

  3. Add code

First, you need to add the following code in the main.js file

You have to known your project's appId and reportApi

Additional, add them in the options

import trackReport from 'jctrans-track-report'

Vue.use(trackReport, {
  router,
  store,
  options: { appId, reportApi },
})

Then, you may have route page tracking and auto track page view

tips:

how to use directive in pages.

v-track-report

<div
  v-track-report="{
    eventCode: 'Event.FOOTER.CN.CLICK',
    extensions: {
        lang: 'zh-CN',
      },
    reportApi: request,
    }"
>
<div/>

v-c-report

<div
  v-c-report="{
    eventCode: 'Event.FOOTER.CN.CLICK',
    extensions: {
        lang: 'zh-CN',
      }
    }"
>
<div/>


// you can use reportUrl to define yourself reportUrl
<div
  v-c-report="{
    eventCode: 'Event.FOOTER.CN.CLICK',
    extensions: {
        lang: 'zh-CN',
      },
    reportUrl: 'track/xxx/send'
    }"
>
<div/>

Readme

Keywords

none

Package Sidebar

Install

npm i jctrans-track-report

Weekly Downloads

23

Version

0.0.11

License

MIT

Unpacked Size

19.2 kB

Total Files

12

Last publish

Collaborators

  • erhangdamowang