Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
analytics-plugin-defer
Advanced tools
Analytics plugin to defer loading plugins until page interaction has occurred
analytics
Facilitates defering other analytics plugins and their associated events tracked with analytics. For example delay loading google-tag-manager
in order to increase PageSpeed and once the deferred plugin is loaded then relay the events that occured prior to it loading to the now loaded plugin.
npm install analytics analytics-plugin-defer
To use, install the package, include in your project and initialize the plugin with analytics.
Below is an example of how to use the browser plugin.
import Analytics from 'analytics';
import googleTagManager from '@analytics/google-tag-manager';
import deferPlugin from 'analytics-plugin-defer';
const analytics = Analytics({
app: 'example',
plugins: [
deferPlugin({ plugins: ['google-tag-manager'] }),
googleTagManager({
containerId: 'GTM-123456',
enabled: false,
}),
],
});
/* Track a page view */
analytics.page();
/* Track a custom event */
analytics.track('customEvent', {
signup: true,
});
/* Identify a visitor */
analytics.identify('user', {
firstName: 'Foo',
lastName: 'Bar',
});
/* Deferred plugin will only load and be sent above events once the user iteracts with the page */
After initializing analytics
with the analyticsDefer
plugin, tracking data will be stored temporarily whenever analytics.page, analytics.track, or analytics.identify are called and will only be sent after there is interaction with the page upon which the deferred plugin is then loaded and the events are replayed.
Option | description |
---|---|
plugins required - string[] | A list of all the plugin names to defer until there is interactoin with the page |
FAQs
Analytics plugin to defer loading plugins until page interaction has occurred
The npm package analytics-plugin-defer receives a total of 4 weekly downloads. As such, analytics-plugin-defer popularity was classified as not popular.
We found that analytics-plugin-defer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.