Google EventsPRO

The Google Events setting enables you to fire events when a form, tab or field is interacted with.

Enable Google Events

To enable Google Events:

  1. Click the form settings icon at the top of the layout editor.
  2. Click the ‘Tracking’ tab.
  3. Check the ‘Enable’ checkbox under ‘Google Events’.
  4. Check one or more of the following options:
    1. Form
      This will fire an event when a form is saved or submitted.
    2. Tabs
      This will fire an event when a tab is clicked on. One event is fired per tab click per form session.
    3. Fields
      This will fire an event when a field is interacted with. One event is fired per field per form session.

Note that WS Form PRO does not install the Google tags for you. You should do that with an additional plugin or embed it in your theme code.

Types of Google Events

There are two types of events fired by WS Form:

  1. Google Tag Manager (Data layer) Learn more
  2. Google Analytics (gtag, ga or _gaq) Learn more

WS Form will automatically determine which types of events can be fired.

Google Tag Manager Events

Google Tag Manager events use the data layer. Events fare fired using the window.dataLayer.push method.

The format of each event is shown below:

Event Format
Form – Submit event: gtm.formSubmit
gtm.element: Form element
gtm.elementID: Form element ID
gtm.elementClasses: Form element classes
gtm.elementUrl: Form element action
wsf.form.id: Form ID
wsf.form.instance_id: Form instance ID
wsf.form.label: Form label
Form – Save event: wsf.form.save
gtm.element: Form element
gtm.elementID: Form element ID
gtm.elementClasses: Form element classes
gtm.elementUrl: Form element action
wsf.form.id: Form ID
wsf.form.instance_id: Form instance ID
wsf.form.label: Form label
Tab event: wsf.tab
gtm.element: Tab element
gtm.elementID: Tab element ID
gtm.elementClasses: Tab element classes
wsf.tab.id: Tab ID
wsf.tab.label: Tab label
Field event: wsf.field
gtm.element: Field element
gtm.elementID: Field element ID
gtm.elementClasses: Tab element classes
wsf.field.id: Field ID
wsf.field.label: Field label

Google Analytics Events

WS Form PRO automatically detects if you have Google Analytics installed and automatically fires events using the code appropriate to your tag version. The following versions of Google Analytics are supported:

  • gtag.js (Universal and Google Analytics 4)
  • analytics.js (Deprecated)
  • ga.js (Deprecated)

The format of each event is shown below:

Event Format
Form – Submit category: Form - #form_label
action: Submit
Form – Save category: Form - #form_label
action: Save
Tab category: Form - #form_label
action: Tab
label: #tab_label
Field category: Form - #form_label
action: Field / Button
label: #field_label

Custom Events

To fire custom events, see the Conversion Tracking action for more information.