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

[addon:google-analytics] Clarify where to add environment variables #9727

Closed
liamross opened this issue Feb 3, 2020 · 4 comments
Closed

Comments

@liamross
Copy link

liamross commented Feb 3, 2020

Is your feature request related to a problem? Please describe.
It's unclear as to where to add the environment variables. According to the README:

Then, set an environment variable

window.STORYBOOK_GA_ID = UA-000000-01
window.STORYBOOK_REACT_GA_OPTIONS = {}

This doesn't specify where they could be added. If I add the following to the beginning of my preview.js file, react-ga throws a warning into console

// In preview.js
window.STORYBOOK_GA_ID = 'UA-0000000-0';
# In console
[react-ga] gaTrackingID is required in initialize()

Describe the solution you'd like
Some clearer documentation around where to add the ENV variables.

Describe alternatives you've considered
I guess if an explanation on this issue is enough then that would work too.

Are you able to assist bring the feature to reality?
Yes, I'd be happy to add the clarification to the README

@liamross
Copy link
Author

liamross commented Feb 3, 2020

Also doesn't work in main.js, but it seems to work when added to the top of manager.js, but based on the documentation I don't know if that's the preferred location.

@stale
Copy link

stale bot commented Feb 25, 2020

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Feb 25, 2020
@stale
Copy link

stale bot commented Mar 26, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Mar 26, 2020
@urish
Copy link
Contributor

urish commented Mar 30, 2020

Thanks for the manager.js tip, worked perfectly for me!

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

No branches or pull requests

3 participants