Skip to content

Analytics

jordan-burns edited this page Feb 22, 2022 · 2 revisions

Analytics

Within formbuilder Analytics events can be raised on Successful completion of a form to the configured Analytics Provider. Within the appsetting.json there is a Analytics which will allow you to enabled and use a configured analytic provider.

{
  "Analytics": {
    "Enabled": true,
    "Type": "GA"
  }
}

Current available providers are:

  • Fake
  • GA(Google Analytics)

How to extend

IAnalyticsProvider is provided to enable integration with different analytics providers. The interface requires a ProviderName and a RaiseEventAsync method. Create a new IAnalyticsProvider which is registered in startup and change the Type within the config section mentioned above in appsetting.json to use the newly created Analaytics Provider.

Google Analytics

To config which Catgegory/Action/Label is used for an event type. For say Finish event, within the GoogleAnalyticsConfiguration you will find an Array[Events], within this you set the EventType to Finish and set the AnalyticsAction, AnalyticsCategory, AnalyticsLabel as desired.

  "GoogleAnalyticsConfiguration": {
    "Events": [
      {
        "EventType": "Finish",
        "AnalyticsCategory": "Category",
        "AnalyticsAction": "action",
        "Analyticslabel": "label"
      }
    ]
  }
Clone this wiki locally