mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-05 16:11:33 +08:00
# Conflicts: # addons/actions/package.json # 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/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 # examples/angular-cli/package.json # examples/mithril-kitchen-sink/package.json
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