Contact Form 7 with Google Analytics 4 Integration using Tag Manager for Event Tracking [2022 Guide]

By 8 months ago

Contact Form 7 (CF7) is a popular and customizable plugin to utilize within WordPress to create all sorts of contact forms and email opt-in forms. We utilize it for intakes, lead generation, and email opt-ins, in addition to Google Analytics 4 (GA4) and Google Tag Manager (GTM) to track our website and marketing performance.

If you already use Google Analytics to monitor website traffic, you also may want to track your contact form submissions as well. If you use Google Analytics Universal, stop right here, and make sure you have the new version, Google Analytics 4 implemented. This is critical because this article does not cover the outdated version of Google Analytics, and Google has mentioned on their developer blog that the old version will not be updated with new features at all so it is borderline obsolete (go here if you use the old version). In addition, we will also be utilizing Google Tag Manager.

In this short guide, we will review how to set up Contact Form 7 to do event tracking with the new Google Analytics 4, along with Google Tag Manager. With the prerequisite that you already have your CF7 forms, GA4, and Tag Manager set up on your website, we will directly move forward with:

  • Using Data Layers & Events to Configure Google Analytics 4 and Contact Form 7
  • Setting up a ‘listener’ tag and an associated trigger in Google Tag Manager (to listen to when successful forms are submitted using a bit of JavaScript you can copy/paste to utilize the Data Layers)

Code Snippets to follow and expand on this guide to setting up CF7 with GA7 and GTM.


Ali Jaffar has been building dazzling websites and creating amazing online experiences for over a decade. His mastery of the latest innovations in web development results in world-class website experiences set apart by show-stopping style and seamless functionality. A highly sought-after consultant, Google Analytics qualified individual, and fifty-time award-winning web development guru, Ali lends his talents to build and bolster digital experiences for a wide array of clients, with a keen focus on web design for nonprofit organizations. When Ali’s not helping his clients grow or providing pro bono services via his Coding For Causes program, you can find him doing yoga, walking his dog, exploring beautiful open spaces, enjoying a nice bike ride, or writing pieces about technology, SEO, Web3 and the world on Huge Thinking and RunningSEO.