Analytics Interaction

forceCommunity:analyticsInteraction

Tracks events that are triggered by custom components in Aura-based Experience Builder sites and sends the data to Google Analytics.

For Use In

Experience Builder Sites

This example creates a custom button and includes the forceCommunity:analyticsInteraction event in the button's client-side controller. Clicking the button sends event data to Google Analytics.

This event is supported in Aura-based Experience Builder sites only. To enable event tracking, add your Google Analytics tracking ID in Settings | Advanced in Experience Builder and publish the site. Google Analytics isn’t supported in sandbox environments.

NameDescriptionTypeDefaultRequired
eventActionThe type of action. Required for 'event' hitType.string
eventCategoryThe type or category of item that was interacted with. Required for 'event' hitType.string
eventLabelA label for providing additional event information.string
eventValueA positive numeric value associated with the event.integer
exDescriptionA description of the exception.string
exFatalTrue if the exception was fatal.boolean
hitTypeThe type of hit. Supported types: 'event', 'social', 'exception', 'timing'.stringYes
socialActionThe type of action that happens. Required for 'social' hitType.string
socialNetworkThe network on which the action occurs. Required for 'social' hitType.string
socialTargetSpecifies the target of a social interaction. Required for 'social' hitType.string
timingCategoryA string for categorizing all user timing variables into logical groups. Required for 'timing' hitType.string
timingLabelA string that can be used to add flexibility in visualizing user timings in the reports.string
timingValueThe number of milliseconds in elapsed time to report to Google Analytics. Required for 'timing' hitType.integer
timingVarA string to identify the variable being recorded. Required for 'timing' hitType.string