Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
// Simply replace `react-ga` with `react-ga4` and remove `ReactGA.pageview()`
// import ReactGA from "react-ga";
import ReactGA from "react-ga4";
npm i react-ga4
import ReactGA from "react-ga4";
ReactGA.initialize("your GA measurement id");
More example can be found in test suite
// Multiple products (previously known as trackers)
ReactGA.initialize([
{
trackingId: "your GA measurement id",
gaOptions: {...}, // optional
gtagOptions: {...}, // optional
},
{
trackingId: "your second GA measurement id",
},
]);
// Send pageview with a custom path
ReactGA.send({ hitType: "pageview", page: "/my-path" });
// Send a custom event
ReactGA.event({
category: "your category",
action: "your action",
label: "your label", // optional
value: 99, // optional, must be a number
nonInteraction: true, // optional, true/false
transport: "xhr", // optional, beacon/xhr/image
});
Parameter | Notes |
---|---|
GA_MEASUREMENT_ID | string Required |
options.nonce | string Optional Used for Content Security Policy (CSP) more |
options.testMode | boolean Default false |
options.gaOptions | object Optional Reference |
options.gtagOptions | object Optional |
Parameter | Notes |
---|---|
fieldsObject | object Required |
This method signature are NOT for UA-XXX
Parameter | Notes |
---|---|
name | string Required A recommended event or a custom event |
params | object Optional |
Parameter | Notes |
---|---|
options | object Required |
options.action | string Required |
options.category | string Required |
options.label | string Optional |
options.value | number Optional |
options.nonInteraction | boolean Optional |
options.transport | 'beacon'|'xhr'|'image' Optional |
Parameter | Notes |
---|---|
fieldsObject | object Required |
import { ReactGAImplementation } from "react-ga4";
class MyCustomOverriddenClass extends ReactGAImplementation {}
export default new MyCustomOverriddenClass();
Use Google Analytics Debugger Chrome Extension to see logs
MIT
FAQs
React Google Analytics 4 (that allows gtag URL to be customised)
The npm package lachie-ga4 receives a total of 0 weekly downloads. As such, lachie-ga4 popularity was classified as not popular.
We found that lachie-ga4 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.