Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jk-analytics

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jk-analytics

I am a log maker, so I write logs JIKE by JIKE.

  • 0.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

JK-Analytics

"I am a log maker, so I write logs JIKE by JIKE."

Installation

$ npm i jk-analytics

Usage

Config: Set Providers via DOM
<script id="jka-providers"
  data-google="UA-3318xxxx-1"
  data-sensors="USER-4e7020cb"
></script>
Config: Set User ID

Set the userId on the tracker:

JKA.setUser(userId, userData)
Config: Set Current Page
// Set the current page, default value of the 'page' field while invoking JKA.event(options)
JKA.setCurrentPage('Home Page')
Track: Page View in SPA
JKA.pageview({
  title: 'My Overridden Page', // Required.
  page: '/my-overridden-page' // Required. This value should start with a slash (/) character.
})
Track: Event

Event Options Table (analogous to GA) :

NameRequiredDescription
pageyesThe name of the page/activity (e.g. About Page)
actionyesThe type of interaction (e.g. View Sune's Portfolio)
labelnoUseful for extra infos (e.g. Junior Frontend Developver)

You can call the event function to track an event:

JKA.event({
  page: 'Download Page',
  action: 'Download Jike app',
  label: 'Superhero button'
})

Or, easily add data-jka="{}" to a DOM element as:

<button data-jka="{
  page: 'Download Page',
  action: 'Download Jike app',
  label: 'Superhero button'
}">Download App</button>
Debugging

To automatically log event options, you can use the debug mode:

JKA.enableDebug()

Supported Analytics

  • Google Analytics
  • Sensors Data

License

MIT

FAQs

Package last updated on 16 Oct 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc