{"id":4714,"date":"2020-09-13T16:50:49","date_gmt":"2020-09-13T13:50:49","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4714"},"modified":"2023-07-02T11:51:53","modified_gmt":"2023-07-02T08:51:53","slug":"webflow-form-tracking-with-and-w-o-google-tag-manager","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-analytics\/webflow-form-tracking-with-and-w-o-google-tag-manager\/","title":{"rendered":"Webflow form tracking with (and w\/o) Google Tag Manager"},"content":{"rendered":"\n

Webflow is a great CMS solution loved by designers. While I’m more of an Elementor fan, I’ve found Webflow to be a good solution for launching pixel-perfect websites.<\/p>\n\n\n\n

Webflow offers native integration with Google Analytics and a simple option to add Google Tag Manager (GTM), so for most simple tracking purposes you can get it up and running in no time.<\/p>\n\n\n\n

In this post, I’ll cover the different methods to track Webflow forms, from simple to more complex solutions. I’ll also show how to add these submission events without<\/strong> Google Tag Manager.<\/p>\n\n\n\n

Thank you page<\/h2>\n\n\n\n

In most cases, using a Thank You page (TYP) is the simplest solution for tracking. You can easily set up Google Analytics goals, Google Ads conversions, Facebook Ads Custom Conversions etc. off of a distinct page URL.<\/p>\n\n\n

\n
\"image-4696287\"
Source: Webflow University<\/a><\/figcaption><\/figure><\/div>\n\n\n

But in some scenarios, you might not want the user to be redirected to a new page, and instead, only show a confirmation notice. In these cases, a different tracking method is required.<\/p>\n\n\n\n

Form Submission Trigger<\/h2>\n\n\n\n

This is the standard trigger for tracking form submissions in GTM. You can set it up with the Form Submission trigger. While this is simple to set up, it isn’t always a solid solution as it might miss submissions (if the tag didn’t run in time) or send false positives on failed submissions.<\/p>\n\n\n

\n
\"\"
Form Submission Trigger in GTM<\/figcaption><\/figure><\/div>\n\n\n

Selecting the Check Validation box won’t work in this case as the form are validated using AJAX.<\/p>\n\n\n\n

Element Visibility Trigger<\/h2>\n\n\n\n

This trigger is more stable than the Form Submission. The basic idea behind this trigger is to identify when a user has viewed a certain element of the page. In this case, we ask GTM to identify users that have seen the Thank Message after successful submission. <\/p>\n\n\n\n

\n

Pro tip:<\/strong>
This trigger works regardless of the text of the Thank You Message<\/p>\n<\/blockquote>\n\n\n\n

To set up this trigger, simply navigate to the Triggers page in GTM a click ‘New’. Select Trigger Type ‘Element Visibility’ and set the Selection Method to ‘CSS Selector’. Paste in the field ‘.success’.<\/p>\n\n\n\n

Finally, check the ‘Observe DOM changes’ box or the trigger won’t be able to identify the new page element.<\/p>\n\n\n

\n
\"image-5741403\"
Form Visibility Trigger in GTM<\/figcaption><\/figure><\/div>\n\n\n

Generic form tracking<\/h2>\n\n\n\n

The next option is to set up a generic Custom Event to indicate form submissions. This option is also my recommended way to track Webflow forms.<\/p>\n\n\n\n

In GTM, create a new tag of the type Custom HTML. Paste into the tag the following script:<\/p>\n\n\n\n

<script type=\"text\/javascript\">\n$(\"form\").submit(function(event) {\n    var formID = $(this).attr('id');\n    dataLayer.push({\n        'event': 'form_submission',\n        'form_id': formID,\n    });\n});\n<\/script><\/code><\/pre>\n\n\n
\n
\"\"
Generic Webflow form tracking tag<\/figcaption><\/figure><\/div>\n\n\n

Trigger the tag on ‘All Pages’.<\/p>\n\n\n\n

This tag will now trigger a Custom Event on each Webflow form submission, with the Event Category ‘form submission’ and Event Action set to the form’s ID in Webflow.<\/p>\n\n\n\n

This Custom Event can now be used to trigger additional platforms such as LinkedIn Ads or Quora Ads.<\/p>\n\n\n\n

Tracking Webflow form submissions without GTM<\/h2>\n\n\n\n

In the unlikely case that you don’t use GTM, you can still use this method to track form conversions.<\/p>\n\n\n\n

Simply add the following snippet to your site’s code:<\/p>\n\n\n\n

<script type=\"text\/javascript\">\n$(\"form\").submit(function(event) {\n    var formID = $(this).attr('id');\n    \/\/ Some code you want to run\n});\n<\/script><\/code><\/pre>\n\n\n\n

For example, if you want to track Facebook Leads and Google Analytics events:<\/p>\n\n\n\n

<script type=\"text\/javascript\">\n$(\"form\").submit(function(event) {\n    var formID = $(this).attr('id');\n   fbq('track', 'Lead');\u200e\n   gtag('event', 'form_submission', {'form_id' : ''});\n});\n<\/script><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

Webflow is a great CMS solution loved by designers. While I’m more of an Elementor fan, I’ve found Webflow to be a good solution for launching pixel-perfect websites. Webflow offers native integration with Google Analytics and a simple option to add Google Tag Manager (GTM), so for most simple tracking purposes you can get it […]<\/p>\n","protected":false},"author":1,"featured_media":4720,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,39],"tags":[50],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4714"}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=4714"}],"version-history":[{"count":10,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4714\/revisions"}],"predecessor-version":[{"id":5668,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4714\/revisions\/5668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media\/4720"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=4714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=4714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=4714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}