Plugin supports the latest Google Analytics tracking code called “Global Site Tag” added via the Google Tag Manager or gtag.js
which usually look like this:
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
</script>
The plugin sends custom tracking events when a form submission is submitted, sent, failed to send or is considered spam.
![Google Analytics custom events associated with Contact Form 7 submissions](https://formcontrols.com/wp-content/uploads/sites/4/2020/07/contact-form-7-events-google-analytics-events.png)
Configuration
Select the Analytics Tracking checkbox in the form settings to enable this feature.
![Contact Form 7 Controls plugin settings for enabling Facebook Pixel conversion tracking](https://formcontrols.com/wp-content/uploads/sites/4/2019/04/contact-form-7-analytics-facebook-pixel-settings-1024x794.png?_t=1574190545)
The plugin automatically detects the presence of the global dataLayer
variable and will register an event with the following parameters:
eventCategory
always set to “Contact Form”,eventAction
as “Submit”, “Spam”, “Sent” or “Error”,eventLabel
as the title of the form.
Related: See the list of all Google Analytics and Metomo (formerly Piwik) tracking events that are triggered automatically for all form submissions.
Get 🚀 PRO
Subscribe to the PRO version of the plugin for advanced analytics and tracking features, and professional support by the plugin author.