Google Tag Manager is a tool that allows you to quickly and easily adjust tracking and marketing automation scripts for your pages from one centralized place. For more info on Google Tag Manager check out Google's documentation here.
Using the Unbounce/GTM Native Integration
Unbounce has an easy way to integrate GTM code snippets to your page using the script manager. It would require 3 different steps:
- Step One: Get Your Container ID from Google Tag Manager.
- Step Two: Enter your Container ID in Script Manager:
- Step Three: Setting up a Custom Event in GTM to track form submissions
Step One: Get your Container ID from Google Tag Manager.
You’ll need your container ID, which you can obtain from your GTM page, follow Google’s instructions to obtain this ID, and copy and save it for Step Two.
Step Two: Enter your Container ID in Script Manager.
Log in to your Unbounce account.
- Under Settings, click Script Manager. Select Google Tag Manager from the dropdown menu and add your Container ID:
- Two panels will open Script Details and Script Usage. In the Script Usage field, select which subdomain(s) you'd like to apply the Google Tag Manager integration to:
- Select Save and Publish Script.
The native integration via Script Manager will automatically place the GTM code on your selected subdomain and its pages.
Step Three: Using GTM to track form submission.
Now that you’ve integrated GTM with the selected subdomain, you can track your Form Submission on your Unbounce page by setting up an event trigger within GTM.
Inside GTM you should use Custom Event triggers (for the `gtm.formSubmit` event) instead of Form Submission triggers to prevent your tag from firing twice.
Here is the step by step instructions on how to set up your Custom Event triggers in GTM:
- Follow Google's instructions on how to set up custom event triggers.
- When you reach the Trigger Configuration step, enter the following information:
- For Trigger Type, select Custom Event.
- For Event Name, use gtm.formSubmit.
- Leave Use regex matching unchecked.
- For This Trigger Fires On, select which option suits your needs.
Unbounce forms are submitted via an AJAX POST request, which makes it difficult to capture the form submission event when not using our native GTM integration.
Manually Setting Up Your Google Tag Manager On A Page
- Republish your page so that the changes take effect.
Now you can control the tags included on your landing pages from Google Tag Manager!
If you want a little help with Google Tag Manager, check out Tag Manager Help below: