How to set up Contact Form 7 tracking

If your website uses Contact Form 7 and you are implementing an advertising campaign, you cannot skip setting the Contact Form 7 conversion for Google Ads and Facebook Ads. This article will help you track Contact Form 7 events using Google Tag Manager to add Contact Form 7 events to Google Analytics and add conversions and advertising channels. And primarily, Lucid Gen also guides you to track the conversion source of Contact Form 7 in Google Analytics, email, and Google Sheets.

Tracking Contact Form 7 events with Google Tag Manager

If you do digital marketing, you are probably familiar with Google Tag Manager; if not, see how to use Google Tag Manager. I will guide you to track Contact Form 7 events with Google Tag Manager without reintroducing the basic knowledge of Google Tag Manager.

Step 1: You create a new Tag of type Custom HTML and insert the code below. Then you select the Trigger as All Pages. The name of the Tag you want can be whatever you want, for example, CF7 Create Event.

<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
    window.dataLayer.push({
    "event" : "cf7submit",
    })
}); 
</script>
Tracking Contact Form 7 events with Google Tag Manager
Tracking Contact Form 7 events with Google Tag Manager

Step 2: You create a new Trigger of type Custom Event and enter the Event name as cf7submit. The Trigger name you want to set is okay, for example, CF7 Submit.

cf7submit
Create Trigger for Contact Form 7 event tracking
Create Trigger for Contact Form 7 event tracking

So you already have an Event and a Trigger of Contact Form 7 in Google Tag Manager. If your purpose is to send Contact Form 7 events to Analytics or install Contact Form 7 conversion for Google Ads and Facebook Ads, please continue to see the sections below.

Event Contact Form 7 in Google Analytics

First of all, you must make sure that you have added Google Analytics to your website. Then follow the instructions to track Contact Form 7 in Google Analytics.

Google Analytics Universal

You add a new Tag of type Google Analytics: Universal Analytics, and set it up as follows:

  • Track Type: Event
  • Category: Contact Form 7
  • Action: Submit
  • Label: {{Page Path}}
  • Google Analytics Settings: You choose or enter the Google Analytics ID of the website.

Note: You can give the Category, Action and Label any name you want. You can leave Action and Label blank.

Next, you chose the Trigger you created earlier; I named the Trigger CF7 Submit in this article.

Create a Contact Form 7 tracking tag with Google Analytics Universal
Create a Contact Form 7 tracking tag with Google Analytics Universal

Google Analytics GA4

If you have upgraded to GA4, please create a new Tag of type Google Analytics: GA4 Event, select Trigger as CF7 Submit and then fill in the following information:

  • Configuration Tag: None – Manually SET ID
  • Measurement: Your Google Analytics GA4 ID
  • Event Name: Contact Form 7
Create a Contact Form 7 tracking tag with Google Analytics GA4
Create a Contact Form 7 tracking tag with Google Analytics GA4

After saving the Tag, remember to publish it for the Tag to work. To check Contact Form 7 events in Google Analytics, go to Real-time > Events.

Tracking Google Form 7 events in Google Analytics
Tracking Google Form 7 events in Google Analytics

Contact Form 7 conversion in Google Ads

Lucid Gen’s Contact Form 7 conversion setup instructions won’t require linking your Google Ads account with Google Analytics. It is very convenient if you are an agency, and it is not suitable to ask customers for Google Analytics permission.

Step 1: Go to your Google Ads account > Tools and Settings > Conversions.

Go to conversion management in Google Ads
Go to conversion management in Google Ads

Step 2: You create a new conversion type website.

Create website type conversion to track Contact Form 7 in Google Ads
Create website type conversion to track Contact Form 7 in Google Ads

Step 3: After you complete the information, go to the tag setup step, select Use Google Tag Manager. Copy the Conversion ID and Conversion label to use for the next step.

Copy Conversion ID and Conversion Label to track Contact Form 7 in Google Ads
Copy Conversion ID and Conversion Label to track Contact Form 7 in Google Ads

Step 4: Return to Google Tag Manager, create a new Tag of type Google Ads Conversion Tracking, enter the Conversion ID and Conversion label copied in the previous step. Next, select Trigger as CF7 Submit, then saves and publish.

Create a Google Ads tag to track Contact Form 7 conversions
Create a Google Ads tag to track Contact Form 7 conversions

To follow if you have installed Contact Form 7 conversion with Google Tag Manager correctly, then install the Tag Assistant Legacy utility (by Google) into Chrome or Coc Coc browser. If you do not know how to use it, please refer to checking if Google Tag Manager is working.

If Tag Assistant Legacy recognizes the Google Ads Conversion Tracking tag, you have successfully installed Contact Form 7 conversion when you submit the form.

Note that Google Ads will record team transfers a few hours later so that you won’t see immediate Contact Form 7 conversion tracking results in your ad reports.

Check Google Ads Contact Form 7 tracking
Check Google Ads Contact Form 7 tracking

Contact Form 7 conversions in Facebook Ads

Before installing the Contact Form 7 conversion for Facebook Ads, ensure you know how to get the Facebook Pixel code; it’s in that Event Source section.

Step 1: If you haven’t added Facebook Pixel to your website yet, create a Custom HTML Tag and paste your Facebook Pixel code in, select All Pages as the Trigger.

Add Pixel to website before setting up Contact Form 7 conversion for Facebook Ads
Add Pixel to the website before setting up Contact Form 7 conversion for Facebook Ads

Step 2: You create a new Tag of type Custom HTML, select Trigger as CF7 Submit. Then you can find one of the most suitable event types below to get the code and paste it into the Tag. You can also refer to some other types of events on Facebook’s information page.

Action eventEvent code
Hoàn tất đăng ký<script>fbq(‘track’, ‘CompleteRegistration’);</script>
Liên hệ<script>fbq(‘track’, ‘Contact’);</script>
Quyên góp<script>fbq(‘track’, ‘Donate’);</script>
Trở thành khách hàng tiềm năng<script>fbq(‘track’, ‘Lead’);</script>
Mua hàng<script>fbq(‘track’, ‘Purchase’, {value: 0.00, currency: ‘USD’});</script>
Lên lịch<script>fbq(‘track’, ‘Schedule’);</script>
Gửi đơn đăng ký<script>fbq(‘track’, ‘SubmitApplication’);</script>

In this article, Lucid Gen chooses the event type as Submit Application (SubmitApplication), then the Tag will look like this. Then save and publish for Tag to work.

Create a Contact Form 7 tracking tag for Facebook Ads
Create a Contact Form 7 tracking tag for Facebook Ads

To check if you have attached Contact Form 7 tracking for Facebook Ads correctly, you need to install the Facebook Pixel Helper utility in the Chrome browser.

If the Facebook Pixel Helper records an event after submitting the form, you have successfully attached Contact Form 7 tracking to Facebook.

Check Contact Form 7 Conversions with Facebook Ads Pixel
Check Contact Form 7 Conversions with Facebook Ads Pixel

You can also check Contact Form 7 conversions directly in Facebook Ads > Events Manager. If you see a submitted event recorded, you can create a new campaign with the conversion goal.

Check out Facebook Ads Contact Form 7 events in Events Manager
Check out Facebook Ads Contact Form 7 events in Events Manager

In addition to Google Ads and Facebook Ads, you can also track Contact Form 7 conversions for other ad networks, and the Trigger part is the same; only the Tag part is different depending on the ad network. Refer to MGID conversion tracking, and you will see precisely that.

Contact Form 7 source tracking

Lucid Gen has received several requests for guidance on tracking the source of Contact Form 7 conversions, especially those of you using Contact Form 7 connected to Google Sheets. So Lucid Gen will guide you methodically.

Contact Form 7 source in Google Analytics using UTM

By default, Google Analytics will automatically record the traffic source, so you don’t need to do anything. Unless you want Google Analytics to professionally source Contact Form 7 conversions for an ad campaign, use Google UTM.

  • Website URL: paste the URL that you use to run ads.
  • Campin source: advertising channels, eg Facebook, Google, Instagram,…
  • Campin medium: advertising format, such as Banner, Click, CPC, Conversion,…
  • Campin name: advertising campaign name, eg BlackFriday, FlashSale,…

Use the link generated by Google UTM for your ad campaigns, and Google Analytics will attribute your Contact Form 7 conversion source to your UTM.

Attach Google UTM to Contact Form 7
Attach Google UTM to Contact Form 7

Contact Form 7 source in email

If you want to send email notifications, including Contact Form 7 conversion source, install the HandL UTM Grabber plugin and follow the instructions.

Requirements: Using UTM, install the HandL UTM Grabber plugin. The plugin version I successfully tested and used for instructions is 2.7.19, if you install the latest version without success, try this.

Step 1: Go to WordPress > Contact > Contact Forms > edit your form and enter the code below before the submit button.

<p style="display:none">
<label style="display:none">[date date-sent hidden "today"]</label>
[utm_source_i]<label style="display:none">[text utm-source "%s"]</label>[/utm_source_i]
[utm_medium_i]<label style="display:none">[text utm-medium "%s"]</label>[/utm_medium_i]
[utm_campaign_i]<label style="display:none">[text utm-campaign "%s"]</label>[/utm_campaign_i]
[utm_term_i]<label style="display:none">[text utm-term "%s"]</label>[/utm_term_i]
[utm_content_i]<label style="display:none">[text utm-content "%s"]</label>[/utm_content_i]
</p>
Add the code to send UTM for Contact Form 7
Add the code to send UTM for Contact Form 7

Step 2: You go through the Mail settings and enter the code below in the body. This code has both UTM and URL, date and time of sending. Do you see Lucid Gen mind? 😀

URL: [_url]
Date: [date-sent]
Time: [_time]

Campaign Source: [utm-source]
Campaign Medium: [utm-medium]
Campaign Name: [utm-campaign]
Campaign Term: [utm-term]
Campaign Content: [utm-content]
Add the code to send Contact Form 7 source UTM in the email
Add the code to send Contact Form 7 source UTM in the email

And this is the result of tracking Contact Form 7 conversions in the email.

Contact Form 7 email notification results with UTM source
Contact Form 7 email notification results with UTM source

Contact Form 7 source in Google Sheets

If you are sending data from Contact Form 7 to Google Sheets and you want to send it in UTM, follow this tip from Lucid Gen. You need to do step 1 of the above section first, then continue following the instructions below.

Requirements: Using UTM, did step 1 of contact form 7 source tracking in email. The version of CF7 Google Sheets Connector that I have successfully tested and instructed is 4.7, if the new version has problems, please try to reinstall this version.

You need to enter the names of columns like this in your Sheets, even though the CF7 Google Sheets Connector does not display the names of these fields in the form settings.

date-sentutm-sourceutm-mediumutm-campaignutm-termutm-content
Submit UTM Contact Form 7 source to Google Sheets
Submit UTM Contact Form 7 source to Google Sheets

Conclusion

Lucid Gen hopes this article will help marketers in advertising with websites that use Contact Form 7. If you found this article valuable and helpful, don’t hesitate to leave a comment and vote 5 for Lucid Gen.

Related articles

Trần Ngọc Minh Hiếu

Trần Ngọc Minh Hiếu

I am currently working as a Data Analyst; before that, I worked in Digital Marketing. Blogging is a joy, helping me share my knowledge and experiences from life and work. You can donate to me here.

2 thoughts on “How to set up Contact Form 7 tracking”

  1. Is the Step 1 (adding the Event listener) to the site necessary for setting the Google Ads Conversions? Whatever I do there is an “Inactive” badge next to my conversion goal.

    Reply

Leave a Comment