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
[email protected] (upgraded) postinstall package.json via @storybook/[email protected]
⚠️ 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
[email protected] (upgraded) Function internals/async-iterator-prototype.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/handlebars.amd.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/handlebars.amd.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/handlebars.amd.min.js package.json via @storybook/[email protected]
[email protected] (added) Function dist/handlebars.amd.min.js package.json via @storybook/[email protected]
[email protected] (added) Function test/index.js package.json via @storybook/[email protected]
[email protected] (added) Function test/index.js package.json via @storybook/[email protected]
[email protected] (added) Function _root.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
[email protected] (added) Function template.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
[email protected] (added) Function test/bigint.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (added) Function test/bigint.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (added) Function test/bigint.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (added) Function bin-prettier.js package.json via @storybook/[email protected]
[email protected] (upgraded) Function dist/cjs/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (upgraded) Function dist/esm/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (upgraded) Function dist/minify.js package.json via @storybook/[email protected]
[email protected] (added) Function tools/node.js package.json via @storybook/[email protected]
@storybook/[email protected] (added) eval dist/cjs/getStorySortParameter.js package.json via @storybook/[email protected]
@storybook/[email protected] (added) eval dist/cjs/getStorySortParameter.js package.json via @storybook/[email protected]
@storybook/[email protected] (added) eval dist/esm/ConfigFile.js package.json via @storybook/[email protected]
@storybook/[email protected] (added) eval dist/modern/ConfigFile.js package.json via @storybook/[email protected]
[email protected] (added) eval dist/docs/assets/js/main.js package.json via [email protected]
[email protected] (added) eval dist/docs/assets/js/main.js package.json via [email protected]
[email protected] (added) eval js/release/util.js package.json via @storybook/[email protected]
[email protected] (added) eval lib/RedisConnection.js package.json via [email protected]
[email protected] (added) eval index.js package.json via @storybook/[email protected]
[email protected] (added) eval third-party.js package.json via @storybook/[email protected]
[email protected] (added) eval third-party.js package.json via @storybook/[email protected]
[email protected] (added) eval third-party.js package.json via @storybook/[email protected]
[email protected] (added) eval third-party.js package.json via @storybook/[email protected]
[email protected] (upgraded) eval dist/cjs/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (upgraded) eval dist/cjs/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (upgraded) eval dist/esm/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (upgraded) eval dist/esm/index.js package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
⚠️ 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
[email protected] (upgraded) gnoff acdlite package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
[email protected] (added) gnoff acdlite package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected]
[email protected] (added) gnoff acdlite package.json via @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], @storybook/[email protected], [email protected]
[email protected] (upgraded) evilebottnawi glenjamin package.json via @storybook/[email protected]
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 [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

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