Form Tracking
Snowplow automatic form tracking detects three event types: change_form
, submit_form
and focus_form
. To enable automatic form tracking, use the enableFormTracking
method. This will add event listeners to all form elements and to all interactive elements inside forms (that is, all input
, textarea
, and select
elements).
Note: that events on password fields will not be tracked.
Installation
npm install @snowplow/browser-plugin-form-tracking
yarn add @snowplow/browser-plugin-form-tracking
pnpm add @snowplow/browser-plugin-form-tracking
Initialization
import { newTracker, trackPageView } from '@snowplow/browser-tracker';
import { FormTrackingPlugin, enableFormTracking } from '@snowplow/browser-plugin-form-tracking';
newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ FormTrackingPlugin() ],
});
enableFormTracking();
Functions
enableFormTracking | Documentation |
Context
This plugin does not add any additional data to context of an event.