Table of Contents
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>
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
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.
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
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.
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.
Step 2: You create a new conversion type website.
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.
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.
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.
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.
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 event | Event 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.
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.
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.
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.
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>
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]
And this is the result of tracking Contact Form 7 conversions in the email.
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-sent | utm-source | utm-medium | utm-campaign | utm-term | utm-content |
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.
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.
Hello Dragan, the step is necessary.