🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

analytics-plugin-trackable-min

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics-plugin-trackable-min

Trackable Plugin

latest
Source
npmnpm
Version
0.4.6
Version published
Maintainers
1
Created
Source

Analytics Window Events Plugin

Fire events on window enter and window leave events

Usage

npm install analytics
npm install analytics-plugin-window-events

After installing the plugin, the windowLeft and windowEnter events will fire.

You can listen to these events via additional plugins or with .on & .once listeners.

import Analytics from 'analytics'
import windowEventsPlugin from 'analytics-plugin-window-events'

/* Example plugin that listener to window */
const customWindowListenerPlugin = {
  NAMESPACE: 'custom-window-listener-plugin',
  windowEnter: () => {
    console.log('Window entered do something via plugin')
  },
  windowLeft: () => {
    console.log('Window left do something via plugin')
  }
}

const analytics = Analytics({
  app: 'my-app',
  plugins: [
    windowEventsPlugin(),
    customWindowListenerPlugin
  ]
})

analytics.on('windowEnter', () => {
  // do stuff when visitor enters window
})

analytics.on('windowLeft', () => {
  // do stuff when visitor leaves window
})

Keywords

analytics

FAQs

Package last updated on 05 Sep 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