Track a custom MVC Form widget
In this tutorial, you create an MVC Form widget for submitting a request for dinner menu. You want to track form submissions to send contact data to Sitefinity Insight. Depending on the specific of your scenario, you can do this by:
- Tracking form submissions server-side
You create a custom event handler, so that the Sitefinity Insight connector tracks forms submissions on your Sitefinity CMS site. - Tracking form submissions client-side
You enable tracking by leveraging Sitefinity Insight JavaScript SDK, so that the connector sends the data as interactions to Sitefinity Insight every time a contact submits the form.
For more information, see:
- Create and register widgets
- Implement custom EventHub events
- Create new data collection handlers
- Track data client-side
PREREQUISITES: You configured the Sitefinity Insight connector. For more information, see Connect to Sitefinity Insight.
Create the custom MVC Form widget
- Create a new class library and name it
CustomFormWidget. - In the
Mvcfolder, create the following folders:- Controllers
- Models
- Views
This section contains
Create the model
Create the model to track a custom MVC form widget in Sitefinity Insight.
Create the view
Create the view to track a custom MVC form widget in Sitefinity Insight.
Create the custom event
Create the custom event to track a custom MVC form widget in Sitefinity Insight.
Create the controller
Create the controller to track a custom MVC form widget in Sitefinity Insight.
Handle the event and build the interactions
Handle the event and build the interactions when tracking a custom MVC form widget.