GoogleAnalyticsGtag

Setup

  1. Sign up for Google Analytics and create a new web propertyarrow-up-right.

  2. Install the target:

    npm install --save @redux-beacon/google-analytics-gtag

Usage

import GoogleAnalyticsGtag from '@redux-beacon/google-analytics-gtag';

// Create or import an events map.
// See "getting started" pages for instructions.

const trackingId = 'REPLACE_WITH_YOUR_TRACKING_ID';
const ga = GoogleAnalyticsGtag(trackingId);

const gaMiddleware = createMiddleware(eventsMap, ga);
const gaMetaReducer = createMetaReducer(eventsMap, ga);

Event Definitions

Don't see your event listed? Please submit a pull request to the Redux Beacon repositoryarrow-up-right with the missing event. Use the source of the existing event-helpers to guide your work. If you need any support feel free to make the pull request with all you're able to do. We can fill in the gaps from there.

pageView

Docs:

https://developers.google.com/analytics/devguides/collection/gtagjs/pagesarrow-up-right

triangle-exclamation

event

Docs:

https://developers.google.com/analytics/devguides/collection/gtagjs/eventsarrow-up-right

Last updated