Analytics Interaction Gtag

forceCommunity:analyticsInteractionGtag

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:analyticsInteractionGtag event in the button's client-side controller. Clicking the button sends event data to Google Analytics.

This example sends a user timing event to Google Analytics indicating that it took 3549 milliseconds for the current web page to load all external JavaScript dependencies. (Credit to Google Analytics documentation.)

This example sends an exception event to Google Analytics if the divisor y is zero. (Credit to Google Analytics documentation.)

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.

NameDescriptionTypeDefaultRequired
descriptionA description of the error.string
eventThe string that will appear as the event action in Google Analytics Event reports.stringYes
event_categoryAn event category is a name that you supply as a way to group objects that you want to analyze. Also, a string for categorizing all user timing variables into logical groups.string
event_labelProvides additional information for events that you want to analyze. Also, a string that can be used to add flexibility in visualizing user timings in the reports.string
fatalTrue if the error was fatal.boolean
nameA string to identify the variable being recorded. Required for 'timing_complete' event.string
valueAn integer used to assign a numerical value to a page object. Also, he number of milliseconds in elapsed time to report to Google Analytics. Required for 'timing_complete' event.integer