mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 08:01:20 +08:00
# Conflicts: # addons/a11y/README.md # addons/a11y/package.json # addons/a11y/src/index.js # addons/actions/package.json # addons/actions/src/lib/decycle.js # addons/actions/src/lib/retrocycle.js # addons/actions/src/lib/reviver.js # addons/backgrounds/package.json # addons/cssresources/package.json # addons/events/package.json # addons/google-analytics/package.json # addons/info/package.json # addons/jest/package.json # addons/knobs/package.json # addons/links/package.json # addons/notes/package.json # addons/ondevice-backgrounds/package.json # addons/ondevice-knobs/package.json # addons/ondevice-notes/package.json # addons/options/package.json # addons/storyshots/storyshots-core/package.json # addons/storyshots/storyshots-puppeteer/package.json # addons/storysource/package.json # addons/viewport/package.json # app/react-native/package.json # app/react/package.json # examples/angular-cli/package.json # examples/cra-kitchen-sink/package.json # examples/mithril-kitchen-sink/package.json # examples/official-storybook/package.json # examples/preact-kitchen-sink/package.json # lib/addons/package.json # lib/channel-websocket/package.json # lib/components/package.json # lib/core/package.json # lib/ui/package.json # yarn.lock
Storybook Addon Google Analytics
Storybook Addon Google Analytics can be used to support google analytics in Storybook.
Getting Started
Install:
yarn add @storybook/addon-google-analytics --dev
Then, add following content to .storybook/addons.js
import '@storybook/addon-google-analytics/register';
Then, set an environment variable
window.STORYBOOK_GA_ID = UA-000000-01