Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Google Analytics v4 #5

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

fgaleano
Copy link

@fgaleano fgaleano commented Mar 9, 2023

Google Universal Analytics is being deprecated later this year and Google Analytics 4 is the currently supported version for stats tracking.

This PR adds support for GA4 by updating the underlying ReactGA library and some associated methods for tracking events in GA.

This targets Storybook v6.x. I will submit a different PR for v7.

I tested this with the local install of SB included in the repo and worked properly in my GA project. I suggest performing the same test by updating the tracking ID in ./storybook/manager.js.

@socket-security
Copy link

Socket Security Pull Request Report

Dependency issues detected: If you merge this pull request, you will not be alerted to the instances of these issues again.

📜 Install scripts

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Package Script field Source
core-js-pure@3.29.0 (upgraded) postinstall package.json via @storybook/react@6.5.16
⚠️ Uses eval

Package uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Avoid packages that use eval, since this could potentially execute any code.

Package Eval Type Location Source
core-js-pure@3.29.0 (upgraded) Function internals/async-iterator-prototype.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/handlebars.amd.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/handlebars.amd.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/handlebars.amd.min.js package.json via @storybook/react@6.5.16
handlebars@4.7.7 (added) Function dist/handlebars.amd.min.js package.json via @storybook/react@6.5.16
is-callable@1.2.3 (added) Function test/index.js package.json via @storybook/react@6.5.16
is-callable@1.2.3 (added) Function test/index.js package.json via @storybook/react@6.5.16
lodash@4.17.21 (added) Function _root.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16, concurrently@5.3.0
lodash@4.17.21 (added) Function template.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16, concurrently@5.3.0
object-inspect@1.10.3 (added) Function test/bigint.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16
object-inspect@1.10.3 (added) Function test/bigint.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16
object-inspect@1.10.3 (added) Function test/bigint.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16
prettier@2.3.0 (added) Function bin-prettier.js package.json via @storybook/react@6.5.16
telejson@6.0.8 (upgraded) Function dist/cjs/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
telejson@6.0.8 (upgraded) Function dist/esm/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
terser-webpack-plugin@4.2.3 (upgraded) Function dist/minify.js package.json via @storybook/react@6.5.16
uglify-js@3.17.4 (added) Function tools/node.js package.json via @storybook/react@6.5.16
@storybook/csf-tools@6.5.16 (added) eval dist/cjs/getStorySortParameter.js package.json via @storybook/react@6.5.16
@storybook/csf-tools@6.5.16 (added) eval dist/cjs/getStorySortParameter.js package.json via @storybook/react@6.5.16
@storybook/csf-tools@6.5.16 (added) eval dist/esm/ConfigFile.js package.json via @storybook/react@6.5.16
@storybook/csf-tools@6.5.16 (added) eval dist/modern/ConfigFile.js package.json via @storybook/react@6.5.16
await-to-js@3.0.0 (added) eval dist/docs/assets/js/main.js package.json via auto@10.27.0
await-to-js@3.0.0 (added) eval dist/docs/assets/js/main.js package.json via auto@10.27.0
bluebird@3.7.2 (added) eval js/release/util.js package.json via @storybook/react@6.5.16
bottleneck@2.19.5 (added) eval lib/RedisConnection.js package.json via auto@10.27.0
depd@1.1.2 (added) eval index.js package.json via @storybook/react@6.5.16
prettier@2.3.0 (added) eval third-party.js package.json via @storybook/react@6.5.16
prettier@2.3.0 (added) eval third-party.js package.json via @storybook/react@6.5.16
prettier@2.3.0 (added) eval third-party.js package.json via @storybook/react@6.5.16
prettier@2.3.0 (added) eval third-party.js package.json via @storybook/react@6.5.16
telejson@6.0.8 (upgraded) eval dist/cjs/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
telejson@6.0.8 (upgraded) eval dist/cjs/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
telejson@6.0.8 (upgraded) eval dist/esm/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
telejson@6.0.8 (upgraded) eval dist/esm/index.js package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/react@6.5.16
⚠️ New author

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

Package New Author Previous Author Source
react@18.2.0 (upgraded) gnoff acdlite package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16, @storybook/theming@6.5.16, react-dom@18.2.0
react-dom@18.2.0 (added) gnoff acdlite package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16, @storybook/theming@6.5.16
scheduler@0.23.0 (added) gnoff acdlite package.json via @storybook/addons@6.5.16, @storybook/api@6.5.16, @storybook/components@6.5.16, @storybook/react@6.5.16, @storybook/theming@6.5.16, react-dom@18.2.0
webpack-hot-middleware@2.25.3 (upgraded) evilebottnawi glenjamin package.json via @storybook/react@6.5.16
Pull request report summary
Issue Status
Install scripts ⚠️ 1 issue
Native code ✅ 0 issues
Bin script confusion ✅ 0 issues
Bin script shell injection ✅ 0 issues
Shell access ✅ 0 issues
Uses eval ⚠️ 36 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
GitHub dependency ✅ 0 issues
New author ⚠️ 4 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
AI detected malware ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore core-js-pure@3.29.0
  • @SocketSecurity ignore handlebars@4.7.7
  • @SocketSecurity ignore is-callable@1.2.3
  • @SocketSecurity ignore lodash@4.17.21
  • @SocketSecurity ignore object-inspect@1.10.3
  • @SocketSecurity ignore prettier@2.3.0
  • @SocketSecurity ignore telejson@6.0.8
  • @SocketSecurity ignore terser-webpack-plugin@4.2.3
  • @SocketSecurity ignore uglify-js@3.17.4
  • @SocketSecurity ignore @storybook/csf-tools@6.5.16
  • @SocketSecurity ignore await-to-js@3.0.0
  • @SocketSecurity ignore bluebird@3.7.2
  • @SocketSecurity ignore bottleneck@2.19.5
  • @SocketSecurity ignore depd@1.1.2
  • @SocketSecurity ignore react@18.2.0
  • @SocketSecurity ignore react-dom@18.2.0
  • @SocketSecurity ignore scheduler@0.23.0
  • @SocketSecurity ignore webpack-hot-middleware@2.25.3

Powered by socket.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant