November 28, 2025

How to Track Leads from Your Website Using Google Analytics and Contact Form 7

By Adrian Lasala
Three blue dice with email, phone, and at symbols float above a tablet held by a person in a blue shirt, representing Astoria Media Group’s innovative digital marketing agency approach.

Back To Blog

Introduction

If your website collects leads through forms, tracking those submissions is essential for understanding which pages, campaigns, and traffic sources are driving real results. Without accurate lead tracking, you’re left guessing whether your marketing efforts are paying off. Fortunately, you can easily monitor form submissions using Google Analytics and Contact Form 7, one of the most popular WordPress plugins for creating contact forms. By integrating these two tools, you can measure lead conversions, analyze user behavior, and make data-driven decisions to improve your website’s performance.

Understanding the Basics of Lead Tracking

Lead tracking means monitoring the actions visitors take that indicate interest in your business—like filling out a contact form, downloading an ebook, or requesting a quote. In Google Analytics, these actions are recorded as events or goals.

When someone submits a form created with Contact Form 7, you can set it up to trigger an event in Google Analytics. This event acts as a “signal” that a conversion has occurred. Tracking these events allows you to see which channels (organic search, ads, social media, etc.) are generating leads and which forms perform best on your site.

Step 1: Install and Set Up Google Analytics

If you haven’t already, create a Google Analytics account at analytics.google.com and add your website as a new property. For most modern websites, Google Analytics 4 (GA4) is the default version.

Once your property is created, Google will provide a Measurement ID (a string that looks like G-XXXXXXX). Copy this ID—you’ll need it to connect Analytics to your WordPress site.

To install Analytics on your website, you can:

  • Use a plugin like Site Kit by Google or GA Google Analytics to add your Measurement ID easily.
  • Alternatively, insert the tracking code manually into your site’s <head> section using your theme settings or a header/footer script plugin.

After setup, verify your connection by visiting your site and checking your Realtime report in Analytics. You should see your active visit appear within seconds.

Step 2: Create Your Contact Form in WordPress

Install the Contact Form 7 plugin from the WordPress Plugin Directory. Once activated, go to Contact → Add New to create your form. You can customize it with fields such as name, email, phone number, and message.

After setting it up, copy the shortcode provided (for example, [contact-form-7 id=”123″ title=”Contact form”]) and paste it into your contact page or sidebar. Publish or update your page to make the form live.

Step 3: Add Event Tracking for Form Submissions

To track when a user successfully submits a form, you’ll need to use Contact Form 7’s built-in JavaScript event listener. This listener triggers whenever a form is submitted successfully.

Here’s a simple script you can add to your site’s footer or a custom JavaScript file:

document.addEventListener(‘wpcf7mailsent’, function(event) {

  gtag(‘event’, ‘form_submission’, {

    ‘event_category’: ‘Contact Form’,

    ‘event_label’: event.detail.contactFormId,

    ‘value’: 1

  });

}, false);

This script uses the Google Analytics 4 (GA4) event tracking format. When a form submission occurs, it sends an event named “form_submission” to your Analytics account with a category and label.

If you’re using Google Tag Manager (GTM), you can achieve the same result by setting up a custom event trigger. In GTM, create a new Trigger that listens for the event wpcf7mailsent and a corresponding Tag that sends data to Google Analytics when the event fires.

Step 4: Verify Event Tracking in Google Analytics

After adding the event tracking script, it’s time to verify that your setup works. Go to Google Analytics → Realtime → Events and submit a test form on your website. If configured correctly, you’ll see an event labeled “form_submission” appear almost instantly.

Once verified, GA4 will continue recording these events every time a user submits a form. You can later analyze these events under Reports → Engagement → Events to see how many form submissions occurred within a given period.

Step 5: Create a Conversion Event in GA4

In GA4, not all events are automatically counted as conversions. To make form submissions count as leads, go to Admin → Events and find “form_submission” in your event list. Toggle the Mark as Conversion switch to ON.

From this point on, every successful form submission will be recorded as a conversion. You can view your conversion data under Reports → Engagement → Conversions, which helps you measure how effectively your site generates leads.

Step 6: Analyze Lead Sources and User Behavior

Now that you’re tracking form submissions as conversions, you can dive into your reports to learn where your leads come from. Go to Reports → Acquisition → Traffic Acquisition in GA4 to view traffic channels like Organic Search, Paid Ads, Social Media, and Referral.

You can also use the Explore section to build custom reports showing which landing pages or campaigns drive the most submissions. For example, if your contact form appears on multiple pages, you can see which pages produce the most conversions—valuable insight for improving your content strategy.

Additionally, combining your conversion data with behavioral metrics (like session duration and engagement rate) gives you a complete view of how users interact with your website before submitting a form.

Step 7: Use Data to Improve Your Conversion Rates

Once you start tracking leads, use the data to make informed improvements. If you notice that certain traffic sources generate a lot of visits but few submissions, revisit your form design, CTA placement, or page copy to encourage more conversions.

You can also experiment with form length and layout—shorter, simpler forms often convert better. A/B testing different versions of your form or landing page can help you identify what resonates most with your audience.

Regularly reviewing your data ensures that your website isn’t just attracting visitors—it’s converting them into real business leads.

Conclusion

Tracking leads from your website with Google Analytics and Contact Form 7 gives you the clarity to understand what’s driving conversions and where to focus your marketing efforts. Once you integrate event tracking and conversion setup, every form submission becomes measurable, helping you optimize both user experience and performance. With consistent analysis and small improvements over time, you’ll turn your website into a reliable, data-driven lead-generation machine.

To see how we build data-driven lead engines for brands: CLICK HERE

Strategic FAQ: Lead Tracking Mastery

Can I track multiple forms separately? Yes. Because the script captures the form_id, you can filter your reports in GA4 to see exactly which form was submitted (e.g., your “Contact Page Form” vs. your “Sidebar Quote Form”).

What if I’m using Google Tag Manager (GTM)? GTM is actually the preferred professional method in 2026. Instead of a hard-coded script, you use a “Custom HTML” tag to push a cf7_submission event into the Data Layer, which then triggers your GA4 tag. This keeps your site code cleaner and more flexible.

Why aren’t my form submissions showing up in GA4? Standard reports in GA4 can take 24–48 hours to process. Always use the DebugView or Realtime report for immediate verification. If it doesn’t show there, check that your theme isn’t missing the wp_footer() call.

Contact Us Today

Ready to Amplify Your Marketing?

Let's create a digital marketing strategy that drives real results for your business.

Get Free Consultation