Skip to content

Commit

Permalink
Merge pull request #8468 from soundasleep/patch-2
Browse files Browse the repository at this point in the history
Fix 'path is required in .pageview()' in GA addon
  • Loading branch information
shilman committed Nov 30, 2019
1 parent 06e41ac commit 0bbbf18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/google-analytics/src/register.ts
Expand Up @@ -8,8 +8,8 @@ addons.register('storybook/google-analytics', api => {
ReactGA.initialize(window.STORYBOOK_GA_ID, window.STORYBOOK_REACT_GA_OPTIONS);

api.on(STORY_CHANGED, () => {
const { url } = api.getUrlState();
ReactGA.pageview(url);
const { path } = api.getUrlState();
ReactGA.pageview(path);
});
api.on(STORY_ERRORED, ({ description }: { description: string }) => {
ReactGA.exception({
Expand Down

0 comments on commit 0bbbf18

Please sign in to comment.