Google Tag Manager

Integrating Google Tag Manager (GTM) with your embedded forms allows you to track useful user interactions and trigger events to Google Analytics. This guide will walk you through the steps required to enable the integration for your form and will demonstrate a basic implementation in Google Tag Manager.

Using this integration requires some technical knowledge of Google Tag Manager and requires that Google Tag Manager already be installed on your website.


Enabling the Google Tag Manager Integration

  1. Navigate to the Integrations page from the main menu.
  2. Scroll through the list of available integrations until you find Google Tag Manager
  3. Click the “Add integration” button to open the configuration page
  4. From the configuration page, click the toggle switch (top-right) to enable
Integrations Page
Google Tag Manager Configuration Page

What is sent to Google Tag Manager

The integration sends several events and data properties to the GTM data layer.

Events

All events prefixed with reform.

  • onFormLoaded
  • onPageChanged - When a page is loaded.
  • form_step_#_complete : form_step_1_complete, form_step_2_complete, etc.
  • onFormCompleted
  • onPageSubmitted
  • onInputChanged - Triggered by any change in any block.

Properties

All properties are in the reformContext object

Sent with every event:

  • form.id
  • form.name
  • form.slug
  • page.id
  • page.slug
  • page.pageNumber - Used with 'step complete' event
  • block & answer - The block ID and answer related to that event. For onInputChanged , it is the block changed. For other events, it is the last block answered.

Sent with onFormCompleted :

  • answers - An object where the keys are block labels and the values are block answers.

Basic GTM Implementation

This section demonstrates a GTM implementation that sends 4 Google Analytics 4 (GA4) events and should be sufficient for most Reform users. It utilizes some, but not all, of the events and data properties available.


This implementation uses best-practice conventions for both Google Tag Manager and also Google Analytics event naming.

Variables

All data layer variables use "Version 2"

  1. Const - GA4 - Measurement ID
    1. Variable Type: Constant
    2. Variable Value: [Your GA4 Data Stream Measurement ID]
  2. DLV - Reform - Form ID
    1. Variable Type: Data Layer Variable
    2. Data Layer Variable Name: reformContext.form.id
  3. DLV - Reform - Form ID
    1. Variable Type: Data Layer Variable
    2. Data Layer Variable Name: reformContext.form.id
  4. DLV - Reform - Form Name
    1. Variable Type: Data Layer Variable
    2. Data Layer Variable Name: reformContext.form.name
  5. CJS - Reform - Event Name
    1. Variable Type: Custom JavaScript
    2. Custom JavaScript
// Removes "reform." from Reform event names. Used for reform step events
// Example: "reform.form_step_1_complete" to "form_step_1_complete"
function() {
  var str = {{Event}};
  return str ? str.substring(7) : '';
}

Triggers

All triggers fire on "All Custom Events"

  1. Event - Reform - Form Displayed
    1. Trigger Type: Custom Event
    2. Event name: reform.onFormLoaded
  2. Event - Reform - Form Started
    1. Trigger Type: Custom Event
    2. Event name: reform.onInputChanged
  3. Event - Reform - Form Step Complete
    1. Trigger Type: Custom Event
    2. Event name: ^reform\.form_step_\d+_complete$ ['Use regex matching' checked]
  4. Event - Reform - Form Submitted
    1. Trigger Type: Custom Event
    2. Event name: reform.onFormCompleted

Tags

  1. GA4 - Reform - Form Displayed
    1. Tag Type: Google Analytics: GA4 Event
    2. Measurement ID: {{Const - GA4 - Measurement ID}}
    3. Event Name: form_displayed
    4. Event Parameters:
      1. form_id | {{DLV - Reform - Form ID}}
      2. form_name | {{DLV - Reform - Form Name}}
    5. Trigger: Event - Reform - Form Displayed
  2. GA4 - Reform - Form Started
    1. Tag Type: Google Analytics: GA4 Event
    2. Measurement ID: {{Const - GA4 - Measurement ID}}
    3. Event Name: form_started
    4. Event Parameters:
      1. form_id | {{DLV - Reform - Form ID}}
      2. form_name | {{DLV - Reform - Form Name}}
    5. ⭐ Advanced Settings: Tag firing options: Once per page
    6. Trigger: Event - Reform - Form Started
  3. GA4 - Reform - Form Step Complete
    1. Tag Type: Google Analytics: GA4 Event
    2. Measurement ID: {{Const - GA4 - Measurement ID}}
    3. Event Name: form_step_completed
    4. Event Parameters:
      1. form_id | {{DLV - Reform - Form ID}}
      2. form_name | {{DLV - Reform - Form Name}}
      3. form_step | {{CJS - Reform - Event Name}}
    5. Trigger: Event - Reform - Form Step Complete
  4. GA4 - Reform - Form Submitted
    1. Tag Type: Google Analytics: GA4 Event
    2. Measurement ID: {{Const - GA4 - Measurement ID}}
    3. Event Name: generate_lead
    4. Event Parameters:
      1. form_id | {{DLV - Reform - Form ID}}
      2. form_name | {{DLV - Reform - Form Name}}
    5. Trigger: Event - Reform - Form Submitted

GTM Tag Example

Please use caution when sending form answer data to Google Analytics. Google prohibits sending Personally Identifiable Information (PII) to Google Analytics. This includes email addresses, names, and phone numbers.


https://support.google.com/analytics/answer/6366371



If you have any specific needs, suggestions or have questions, please contact us at [email protected]. We're here to assist you!

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.