Track form submissions with Google Tag Manager

Tabata Vossen -

While talking with marketers, we noticed that one of the most common actions that they need to track in their Qualifio campaigns is the submission of a form. In this tutorial, we’ll show you how to use Google Tag Manager (GTM) to track your Qualifio form submissions in Google Analytics.

Prerequisite: In this article, we assume that you have already installed your GTM configuration tag as well as a cookie consent banner on your website and/or on your Qualifio minisite.

To track Qualifio form submissions in GTM, your best bet is to create a tag that will push an event into the GTM data layer when your form is submitted.

If you’re feeling a little confused, don’t worry. What we are going to show you is an easy method and the configuration is pretty straightforward.

So… let’s get started.

Step 1: Create a tag in the Tag Library

  1. In your Tag Library, go to Tags.
  2. Click the Create a tag button.
  3. In the Name field, enter GTM event “Form submitted”. (We use this tag name for easy identification, but if you want, you can name it something else. There is no strict requirement of how that tag should be named.)
  4. Leave the Head part empty.
  5. Copy and paste this ready-to-use tag into the Body part.
<script type="text/javascript"> 
$(function() {

var tp = _qlf_taggingplan;

if (tp.getStepName() == 'identityset') {
_qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
_qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
'event':'qlf_event_step',
'qlf_step':'form',
'qlf_title': qlfDataLayer[0]['title'],
'qlf_path': qlfDataLayer[0]['page_path']
}]);
}]);
}
});
</script>

Take a look at the screenshot below to see what we mean:

Schermafbeelding_2022-08-16_om_14.44.36.png

6. Click Save.

So that’s how you would send over your data to Google Tag Manager.

Step 2: Configure your tag manager

Now, to make the work in GTM much faster, you can import the awesome variable and trigger templates our expert has prepared for you! Here is the collection of templates (JSON) you should import.

Go to your GTM container’s Admin section and click Import Container. If you want to learn more about container import in Google Tag Manager, read Google’s guide.

Important: Make sure you choose the import option Merge. This is really important because this option will let you keep your existing tags, triggers and variables, and just add the new ones from Qualifio. If you choose the Overwrite option, it will clear the GTM container and delete ALL your existing tags, triggers and variables.

The last step in configuring your tag manager is simply creating a tag that will record the event in Google Analytics (or your preferred analytics tool). Select the trigger “Qualifio Action – Form submitted” that you imported in order to fire the tag when a form is submitted.

Done!

Here is an overview of the final setup:

Schermafbeelding_2022-09-02_om_16.48.23.png

Step 3: Testing

To test if it’s working, add your tag to a campaign:

Schermafbeelding_2022-08-16_om_14.48.03.png

Fill out that campaign’s form and click submit.

Now, if you go to your Google Analytics account under the real-time reporting section, under Events, you’ll see events are recorded.

So there you have it! And if you plan to use the GTM event “Form submitted” tag in most campaigns, you can also add it as a default tag on your Qualifio websites or minisite templates.

By the way, the objective here was to push an event to Google Tag Manager whenever a participant submits a form specifically, but many other interactions can be tracked: participation button clicks, opt-ins, social shares and more!

If you need help with your tracking implementation or if you want more information, don’t hesitate to contact us via this form.

Was this article helpful?

Can’t find the answer you need?

Send us a question and connect with an expert to get personal assistance.

Contact support

Vous ne trouvez pas les réponses que vous cherchez ?

Nous sommes là pour vous aider. Envoyez-nous une demande en direct !

Contacter le support
helpcenter experts