Send booking form events to Google Tag Manager
The form pushes an event onto the page's Google Tag Manager data layer at five points as the customer moves through it. You choose the name of each event. A point with no name pushes nothing.
Before you start
- This needs a booking form subscription. Without one the page says "Want to allow Google Tag Manager events on your form?", every box is disabled and there is no Save button. Nothing from this page is published to the form.
- Your Google Tag Manager container has to be loaded on the web page that holds the form. Formpiece does not load it, and the page says that is your responsibility.
Step by step
- Open your form from Forms, then the Integrations tab, then Google Tag Manager.
- Type a name in each Custom event trigger name box you want to use. Each name can be up to 40 characters.
- Click Save. The page says "Google Tag Manager settings updated."
- In Tag Manager, add a trigger for each name, as below.
Set up the triggers in Tag Manager
The form only pushes the name. Nothing happens in Tag Manager until a trigger listens for it.
- In your container, go to Triggers.
- Click New and choose (Other) Custom Event as the trigger type.
- Enter the same name you typed in Formpiece as the Event name.
- Go to Tags, open the tag that should fire, and add the trigger to it.
The page notes that some tags need extra configuration before a trigger fires them.
What each box sends
| Box | Pushed when |
|---|---|
| Custom event trigger name: First Engagement | The first time the customer types in the first name, surname, company name, phone or email box. Once for each time the form loads. |
| Custom event trigger name: Service selected | The customer picks a service. |
| Custom event trigger name: Date selected | The customer picks a date, each time they pick one. |
| Custom event trigger name: Time selected | The customer picks a time or a time group, each time they pick one. |
| Custom event trigger name: Form submission | The booking is accepted and the form shows its success message. For a form that takes a payment, it is pushed when the customer comes back from the payment step and the booking is confirmed. |
Each push is { event: "your name" } added to window.dataLayer. The form creates the data layer if the page does not have one yet.
When it goes wrong
A trigger never fires
- The container is not loaded on the page that holds the form.
- The trigger's Event name is not exactly the name in Formpiece.
- The tag is not attached to the trigger.
- The name box in Formpiece is empty, or the account has no booking form subscription.
I saved but the live form did not change
Saving writes the settings and then publishes the form. If the page says "Could not save Google Tag Manager settings. Please try again later.", the settings may be saved but not live. Save again.