You require AEM form add-on package to enable Analytics on AEM Forms. For more information, see Installing and configuring AEM forms.

Out of the box, the following events are tracked in an analytics enabled Adaptive Form:

Event Available variables
impression formName, formTitle, source
render formName, formTitle, formInstance, source
abandon formName, formTitle, formInstance, panelName, panelTitle
save formName, formTitle, formInstance, panelName, source
submit formName, formTitle, formInstance, source
error formName, formTitle, fieldName, fieldTitle, panelTitle
help formName, formTitle, fieldName, fieldTitle, panelTitle
fieldVisit formName, formTitle, fieldName, fieldTitle, panelTitle
panelVisit formName, formTitle, panelName, panelTitle

Customizing the field visit event timeout

On the default AEM form setup, if a user spends more than 60 seconds on a field, a fieldvisit event is triggered and the details of the field are sent to Adobe Analytics. You can customize the Field time tracking baseline under AEM Forms Analytics Configuration at AEM Configuration console (/system/console/configMgr) to increase or decrease the timeout limit.  

Customizing the tracking events

 You can modify the trackEvent function available in /etc/clientlibs/fd/fmaddon/afanalytics/js/custom.js file to customize the event tracking. Whenever an event that is being tracked occurs in an adaptive form, the trackEvent function is called. The trackEvent function accepts two parameters: eventName and variableValueMap.

You can evaluate value of eventName and variableValueMap arguments to change the tracking behavior of events. For example, you can choose to send the information to analytics server after a certain number of error events occur. You can also choose to perform any of the following customizations:

  • You can set a threshold time before sending the event.
  • You can maintain a state to decide action, for example, fieldVisit pushes a dummy event based on the timestamp of the last event.
  • You can use the pushEvent function to send the event to analytics server .
  • You can choose to not push the event to analytics server at all.


In the following example, state for the error event of each fieldName attribute is maintained. The event is sent to the analytics server only if an error occurs again.

case 'error':
        if(errorOccurred[variableValueMap.fieldName] == true) {
            pushEvent(eventName, variableValueMap)
        errorOccurred[variableValueMap.fieldName] = true;

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy