In addition to the “standard” predefined events available upon enabling the “Event Tracking module”, “onClick” and “onSubmit” DOM events can also be defined to log such events in your contacts’ ActiveCampaign records, as well as a shortcode for page/post level logging.

onClick

To define/set an “onClick” logging event on any “clickable” DOM element, use HTML5 data-* attributes, as shown in the examples below:

Syntax:


Typical usage:

onSubmit

To define/set an “onSubmit” logging event for an HTML form, use HTML5 data-* attributes, as shown in the examples below:

Syntax:


Typical usage:


Note:

The “onSubmit” event is triggered and logged immediately upon submission of the form, whether it was submitted successfully or not, i.e. before any form validation takes place.

Shortcode

Finally, there is also a shortcode that can be used to trigger event logging at the page/post level. See: [mbr_log_event] shortcode for details.