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

lazy-analytics

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-analytics

Package that helps to add Google Analytics, Adobe Analytics, Facebook Pixel, Twitter Pixel and Linkedin Pixel to your website.

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

Lazy Analytics

This package is a helper to have some platform analytics in your website, the idea is to be able to add them as easy as possible. Is also important to us to be able to initialize the analytics in the moment that we consider and to be able to trigger global events on change route.

GitHub last commit GitHub license GitHub forks GitHub contributors GitHub issues

Lazy analytics is compatible with:

  • Google Analytics.
  • Adobe Analytics.
  • Facebook Pixel.
  • Twitter Pixel.
  • Linkedin Pixel.

Installation

npm install --save lazy-analytics

Usage

import { initAnalytics } from 'lazy-analytics';

// After app configuration
const options = {
  route: null,
  google: 'google analytics code',
  facebook: 'facebook pixel code',
  linkedin: 'linkedin pixel code',
  twitter: 'twitter pixel code',
  adobe: 'adobe analytics code'
};

initAnalytics(options);

Note: You need to add at least one of them, but is not necessary to add all.

Global events

If you have a router like vue-router you can add a global trigger for each route change.

import { onRouteChangeAnalytics } from 'lazy-analytics';

// After route change
onRouteChangeAnalytics(route);

Keywords

FAQs

Package last updated on 09 Jun 2020

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