Google Tag Manager
Integrating Google Tag Manager (GTM) with your forms on our platform allows you to track user interactions and events efficiently. This guide will walk you through the steps required to enable the GTM integration on your site. Before proceeding, ensure that Google Tag Manager is already installed on your website, as this integration is intended for embedded forms.
Step-by-Step Guide to Enable GTM Integration
1. Find the GTM Integration
- Navigate to the Integrations page from the main menu.
- Scroll through the list of available integrations until you find Google Tag Manager.
- Click on “Add integration” to open its configuration page.
2. Enable the GTM Integration
- In the GTM integration page, locate the toggle switch at the top right corner.
- Toggle the switch to the On position to enable the integration.
3. Confirm Your GTM Integration
- Once the toggle is enabled, your form is now integrated with Google Tag Manager.
- All parent page events will be sent to the GTM data layer.
Variables
To effectively track form events, you'll need to create several variables in GTM that reference information from the data layer. These variables will capture essential details about your forms, such as the form ID, form name, page ID, and form answers.
1. Reform Form ID Variable
- Purpose: This variable captures the unique ID of the form from the data layer.
- Configuration:
- Variable Type: Data Layer Variable
- Data Layer Variable Name: reformContext.form.id
2. Reform Form Name Variable
- Purpose: This variable references the Reform form name from the data layer.
- Configuration:
- Variable Type: Data Layer Variable
- Data Layer Variable Name: reformContext.form.name
3. Reform Page ID Variable
- Purpose: This variable references the Reform page id from the data layer
- Configuration:
- Variable Type: Data Layer Variable
- Data Layer Variable Name: reformContext.page.id
4. Step Number Lookup Table
- Purpose: Converts the pageId to a readable step number (e.g., step_1_completed, step_2_completed).
- Configuration:
- Variable Type: Lookup Table
- Input Variable: Reform page id
- Lookup Key-Value Pairs:
- Example: e574cbbc-79fd-43bb-857 -> 1
5. Form Answers Variable
- Purpose: This variable captures the form answers provided by the user from the data layer.
- Configuration:
- Variable Type: Data Layer Variable
- Data Layer Variable Name: reformContext.answers
Triggers
Triggers determine when your tags should fire. Below are examples of triggers you can set up to track form completion and specific form submissions.
1. Form Completion Trigger
- Purpose: Fires when any form is successfully completed.
- Configuration:
- Trigger Type: Custom Event
- Event Name: reform.onFormCompleted
2. Specific Form Completion Trigger
- Purpose: Fires when a specific form is successfully completed.
- Configuration:
- Trigger Type: Custom Event
- Event Name: reform.onFormCompleted
- Additional Condition:
- Variable: Reform Form id
- Condition: Equals
- Value: [Your Specific Form ID]
Tags
Tags are what send the information to your analytics tool or other third-party services. Below is an example of setting up a tag to send form completion data to GA4.
1. GA4 Event Tag for Form Completion
- Purpose: Fires a GA4 event when a form is completed.
- Configuration:
- Tag Type: Google Analytics: GA4 Event
- Event Name: generate_lead
- Event Parameters:
- form_name -> Reform form name
- project_type -> Reform answer project type
- category -> Reform answers category
By setting up these variables, triggers, and tags in GTM, you can effectively track and analyze how users interact with your forms. This will provide valuable insights into user behavior and help optimize form performance on your website.
If you have any specific needs, suggestions or have questions, please contact us at [email protected]. We're here to assist you!