Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
workbox-google-analytics
Advanced tools
Queues failed requests and uses the Background Sync API to replay them when the network is available
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.
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'
}
});
The sw-offline-google-analytics package is another library that helps you integrate Google Analytics with service workers. It provides similar functionality to workbox-google-analytics, such as tracking offline events and sending them when the user is back online. However, it is not part of the Workbox suite and may require more manual setup.
The offline-plugin is a webpack plugin that provides offline support for web applications. It includes a feature for integrating with Google Analytics to track offline events. While it offers broader offline capabilities beyond just Google Analytics, it may be more complex to configure compared to workbox-google-analytics.
This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-google-analytics
FAQs
Queues failed requests and uses the Background Sync API to replay them when the network is available
The npm package workbox-google-analytics receives a total of 2,546,700 weekly downloads. As such, workbox-google-analytics popularity was classified as popular.
We found that workbox-google-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.