Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
volto-google-analytics
Advanced tools
Changelog
Readme
A widget for Volto to insert values for any language enabled
To be used with mrs-developer, see Volto docs for further usage informations.
Created with voltocli.
If using Volto < 16, use v1.3.0.
Add in your .env
file of choice a variable:
RAZZLE_GA_CODE=UA-XXXXXXXX-X
#to use simple Universal Analytics (will be depracated in 2023)
RAZZLE_GA4_CODE=G-xxxxxxx
#to use Google Analytics 4f
and include useGoogleAnalytics
in your project, like:
import { useGoogleAnalytics } from 'volto-google-analytics'
const Footer = () => {
useGoogleAnalytics()
return (
...
)
}
If your portal needs to follow GDPL, you can pass a parameter to the useGoogleAnalytics
hook telling it whether or not we can create a cookie. If false
is passed, GA will not be initialized, causing the cookie not to be created. The page view will also not be counted. If true
is passed and GA has not been initialized, it will be initialized and the cookie will be written. If the parameter is not passed, true
will be assumed. Example:
import { useGoogleAnalytics } from 'volto-google-analytics'
const Footer = ({cookieAllowed}) => {
useGoogleAnalytics(cookieAllowed);
return (
...
)
}
By default, Google Analytics cokkies expiration is set to 6 month. But you colud change the expiration period (expressing it in seconds), setting it from config:
config.settings['volto-google-analytics'].cookieExpires = 6 * 30 * 24 * 60 * 60; // in seconds. Default: 6 month
Google will deprecate Universal Analytics on July 1, 2023, in favor of Google Analytics 4. Unitl that date, you could use Universal Analytics and Google Analytics 4 simultaneously, simply adding both RAZZLE_GA_CODE and RAZZLE_GA4_CODE in your .env.
FAQs
Volto addon for Google Analytics integration
The npm package volto-google-analytics receives a total of 67 weekly downloads. As such, volto-google-analytics popularity was classified as not popular.
We found that volto-google-analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.