frontity.settings.js
:state.googleAnalytics.trackingId
: to specify just one tracking IDstate.googleAnalytics.trackingIds
: to specify a list of tracking ID's@frontity/google-analytics
package can co-exist with some other analytics
packages. Once we have properly installed and configured these analytics
packages, their actions will be centralized by the analytics
namespaceactions.analytics.pageview()
will take into account settings in state.analytics.pageviews
actions.analytics.event()
will take into account settings in state.analytics.events
actions.analytics.pageview
@frontity/google-analytics
is configured and enabled for pageviews in state.analytics.pageviews
, every time a link changes (or every time action.router.set(link)
is launched) a tracking for that page will be sent to Google Analytics by using internally actions.analytics.pageview()
actions.analytics.event
@frontity/google-analytics
is configured and enabled for events in state.analytics.events
, every time you call the method actions.analytics.event()
from any of your React components, the proper tracking info will be sent to Google Analytics.actions.analytics.event()
must receive an event object with the following properties.payload
payload
object has to have the following format:category