Socket
Socket
Sign inDemoInstall

workbox-google-analytics

Package Overview
Dependencies
Maintainers
4
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-google-analytics

Queues failed requests and uses the Background Sync API to replay them when the network is available


Version published
Weekly downloads
3.3M
decreased by-16.09%
Maintainers
4
Weekly downloads
 
Created

What is workbox-google-analytics?

The workbox-google-analytics package is a module within the Workbox suite that helps you integrate Google Analytics into your service worker. It allows you to automatically track offline Google Analytics events and send them when the user comes back online.

What are workbox-google-analytics's main functionalities?

Offline Google Analytics

This feature allows you to automatically track Google Analytics events even when the user is offline. The events are stored and sent to Google Analytics when the user comes back online.

import { initialize } from 'workbox-google-analytics';

initialize();

Custom Cache Name

You can specify a custom cache name for storing Google Analytics events. This is useful if you want to manage the cache more granularly.

import { initialize } from 'workbox-google-analytics';

initialize({
  cacheName: 'custom-google-analytics-cache'
});

Parameter Customization

This feature allows you to customize the parameters sent with each Google Analytics hit. For example, you can add a custom dimension to indicate that the hit was sent while offline.

import { initialize } from 'workbox-google-analytics';

initialize({
  parameterOverrides: {
    cd1: 'offline'
  }
});

Other packages similar to workbox-google-analytics

Keywords

FAQs

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