Subscribe to our social networks

arrow icon All Post

How to Implement Thank You Page Tracking with Google Tag Manager

Apr 04, 2024 | Author: Info Publytics

How to Implement Thank You Page Tracking with Google Tag Manager

In this guide we will demonstrate how to implement Thank You page tracking using Google Tag Manager and subsequently push this data as events to Google Analytics.

If you're familiar with GTM, you know that every interaction to be tracked requires a tag and a trigger. To track form submissions with Google Analytics, you'll need to create a Google Analytics 4 Tag and a Trigger that specifies when the tag should fire.

Creating a tag is the straightforward part.

Presuming you have already installed Google Analytics 4, ensure your container contains the Google tag and the Constant variable (with your GA4 measurement ID).

Once you have a Google tag and a Constant Variable in your GTM container, follow these steps to create a GA4 event tag, which will be used throughout this guide:

  1. 1. Go to Tags.
  2. 2. Click on the New button.
  3. 3. Choose Google Analytics > Google Analytics: GA4 Event in Tag Configuration.
  4. 4. Insert your constant variable (with Measurement ID) in the Measurement ID section to reuse some settings from the Google tag.
  5. 5. Enter "generate_lead" in the Event Name field.
  6. 6. Leave the Triggering part empty for now and click Save.

Creating a Trigger

You’ll track the Thank You Page if the standard form listener in Google Tag Manager doesn't work. In such cases, the form redirects a user after successful submission to another page.

If so, identify the URL it redirects to - the form success URL. Is this address unique? Can users navigate to that page without submitting a form?

If the success page is unique, proceed to create a trigger that fires only on that success page:

  1. 1. Go to Triggers in Google Tag Manager.
  2. 2. Click on the New button.
  3. 3. Choose the trigger type as Pageview. Select the Some page views option for conditional firing.
  4. 4. Set a rule for this trigger based on the success page URL, for example:
    • 4.1 Page Path equals /form/thankyou.html.
    • 4.2 Page URL contains /form/thankyou.html. Be specific to avoid accidental triggers.
  5. 5. Properly name the trigger, for instance: Pageview – Successful Form Submission.

Testing

Assign the newly created trigger to the Google Analytics 4 Tag.

  1. 1. Open (or refresh) the Preview and Debug mode.
  2. 2. Fill in the form and submit it. Ensure the Google Analytics 4 Tag fires upon successful submission.
  3. 3. Optionally, try submitting a different form on your website to verify the tag's functionality.
  4. 4. Check Google Analytics 4 Debug View for confirmation.

For websites with multiple forms with different thank you pages, GA4 automatically tracks page_location. However, if you have multiple forms leading to one "Thank you" page, follow these steps:

  1. 1. Ensure you can obtain a variable containing a form identifier (e.g., form id, form name, etc.).
  2. 2. Include this identifier as an additional parameter in the GA4 form_submission event tag, for example:
    • "form_id" or "form_name".

 


Posted: 1 month ago
Author: Info Publytics

Recent Posts

bg img

    Are you looking for a complete tool to measure your website's progresses? Get deep into Publytics with our 14 Days of free trial!

  • Try it for free