Title: Contact Form 7 Google Analytics
Author: macbookandrew
Published: <strong>27 de abril, 2016</strong>
Last modified: 6 de diciembre, 2025

---

Search plugins

![](https://ps.w.org/cf7-google-analytics/assets/banner-772x250.jpg?rev=2624045)

![](https://ps.w.org/cf7-google-analytics/assets/icon-256x256.jpg?rev=2624045)

# Contact Form 7 Google Analytics

 By [macbookandrew](https://profiles.wordpress.org/macbookandrew/)

[Download](https://downloads.wordpress.org/plugin/cf7-google-analytics.1.8.12.zip)

 * [Details](https://pe.wordpress.org/plugins/cf7-google-analytics/#description)
 * [Reviews](https://pe.wordpress.org/plugins/cf7-google-analytics/#reviews)
 *  [Installation](https://pe.wordpress.org/plugins/cf7-google-analytics/#installation)
 * [Development](https://pe.wordpress.org/plugins/cf7-google-analytics/#developers)

 [Support](https://wordpress.org/support/plugin/cf7-google-analytics/)

## Description

Adds Google Analytics Event Tracking to all Contact Form 7 forms sitewide, using“
Contact Form” as the Event Category, the Contact Form 7 event as the Event Action,
and the form name as the Event Label.

Supports the most popular Google Analytics plugins, including the following:

 * [Google Analytics by MonsterInsights](https://wordpress.org/plugins/google-analytics-for-wordpress/),
   formerly “Google Analytics by Yoast”
 * [Google Analytics Dashboard for WP](https://wordpress.org/plugins/google-analytics-dashboard-for-wp/)
   by Alin Marcu/ExactMetrics
 * [Google Analytics](https://wordpress.org/plugins/googleanalytics/) by Kevin Sylvestre
 * [Google Analytics](https://wordpress.org/plugins/pc-google-analytics/) by Praveen
   Chauhan
 * [Analytics Tracker](https://wordpress.org/plugins/analytics-tracker/) by Valeriu
   Tihai
 * [Enhanced Ecommerce Google Analytics Plugin for WooCommerce](https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/)
   by Tatvic
 * The default Google Analytics code copied from the Analytics admin panel (both
   the newer `gtag.js` and the older universal `analytics.js`)
 * Google Tag Manager (using `gtm.js`) (see additional setup instructions in the
   FAQ section)
 * Any other plugin using `gtag`, `ga`, `_gaq`, or `__gaTracker` as the Javascript
   function
 * To add others, [open a pull request](https://github.com/macbookandrew/cf7-google-analytics)

## Installation

 1. Install and activate the plugin
 2. Enable the actions you would like to send (if you skip this step, it will send 
    all available actions).
 3. Enjoy!

## FAQ

### What about GDPR (General Data Protection Regulation)?

This plugin does not collect or send any personal information or form submissions
to Google Analytics. The only form-related information sent is the name of the form
and the submission result (invalid, spam, mail sent, mail failed, and sent).

Google Analytics does collect more information including, but not limited to, the
following:

 * Page name, URL, and language
 * Screen and window size
 * The user’s IP address

For more information, refer to [Google’s compliance information](https://privacy.google.com/businesses/compliance/#?modal_active=none).

Please also note that Contact Form 7 and other plugins may collect, process, or 
store user data.

### Where will events show up?

Check your statistics in Google Analytics under _Behavior > Events_ or under _Real-
Time > Events_.

### What events will be shown?

This depends on the settings you choose.

 * **Invalid** – Fires when an Ajax form submission has completed successfully, 
   but mail hasn’t been sent because there are fields with invalid input.
 * **Spam** – Fires when an Ajax form submission has completed successfully, but
   mail hasn’t been sent because a possible spam activity has been detected.
 * **Mail Sent** – Fires when an Ajax form submission has completed successfully,
   and mail has been sent.
 * **Mail Failed** – Fires when an Ajax form submission has completed successfully,
   but it has failed in sending mail.
 * **Sent** – Fires when an Ajax form submission has completed successfully, regardless
   of other incidents.
    - This is the only event available if you have Contact Form 7 version 4.7 or
      earlier.
    - This is the only original event sent by this plugin. I recommend enabling 
      the other four and disabling this event, unless you need it for old goals 
      you had set up from several years ago.

### How do I set a goal in Google Analytics?

Note: these instructions are provided for reference and may become out of date if
Google Analytics changes their feature set or labels.

 1. Click on “Admin” in your Google Analytics account menubar
 2. In the right-most column (“View”), click on “Goals”
 3. Click on the “+ New Goal” button
 4. Set the Goal description
 5.  a. Enter a name for the goal (I suggest “Contact Forms”)
     b. Choose the “Event” radio button and click “Continue”
 6. Set the Goal details
 7.  a. Set the “Category Equals to” field to “Contact Form 7”
     b. Set the “Action Equals to” field to the event you wish to track ([see above](https://wordpress.org/plugins/cf7-google-analytics/#what%20events%20will%20be%20shown%3F)
        for a list of events)
     c. If you want to define goals for specific form, enter the name of your form in 
        the “Label” field
     d. Click the “Save” button

### How do I use this with Google Tag Manager (gtm.js)?

 1. In your Google Tag Manager workspace, add a new Trigger.
 2.  a. Choose trigger type: “Other/Custom Event”
     b. Set “Event name” to “Contact Form 7”
     c. Set “This trigger fires on” to “Some Custom Events”
     d. Set the dropdowns to “Event contains Contact Form 7”
     e. Save the trigger
 3. In your Google Tag Manager workspace, add a new Tag.
 4.  a. Choose tag type: “Universal Analytics”
     b. Change “Track Type” to “Event”
     c. Set “Category” to “Contact Form 7”
     d. Set “Label” to “{{Event}}”
     e. Click in the “Triggering” box and choose the trigger you set up above.
 5. Save and publish your changes.

## Reviews

![](https://secure.gravatar.com/avatar/7da89b433324ad3710c74d38f63adcc8d0b70cfb2e7b7e0e8d9d8a166d902c5c?
s=60&d=retro&r=g)

### 󠀁[Great support and works well](https://wordpress.org/support/topic/great-support-and-works-well/)󠁿

 [emigeorge](https://profiles.wordpress.org/emigeorge/) 28 de mayo, 2019 1 reply

You need to follow the steps carefully and it will work for sure 🙂 Highly recommended.

![](https://secure.gravatar.com/avatar/4f9dbcb95cdd98490b2e5a903378ed7ce3b79204a7e34555410b6b13d2d79d6e?
s=60&d=retro&r=g)

### 󠀁[Good Plugin with great support!](https://wordpress.org/support/topic/good-plugin-with-great-support-13/)󠁿

 [Anonymous User 14018805](https://profiles.wordpress.org/anonymized-14018805/) 
12 de noviembre, 2018

The plugin is well coded and the developer listens and improve from feedback of 
users

![](https://secure.gravatar.com/avatar/526d2f739d6579673be04ffd18125c4e9042094b519f6072f531c69d643fd171?
s=60&d=retro&r=g)

### 󠀁[Produce 2 events](https://wordpress.org/support/topic/produce-2-events/)󠁿

 [ildruido99](https://profiles.wordpress.org/ildruido99/) 5 de noviembre, 2018 5
replies

It works but.. it produce 2 different action, ‘Sent’ and ‘Mail Sent’. The problem
is that in the GA Goals you can set only one of them so you must set 2 different
goal for the same action.. how can fix that?

![](https://secure.gravatar.com/avatar/7612499669880ae55246fe051156d069d20eed6c7c00b9f6908137e7a67fe054?
s=60&d=retro&r=g)

### 󠀁[Great free addition to CF7](https://wordpress.org/support/topic/great-free-addition-to-cf7/)󠁿

 [kkw2709](https://profiles.wordpress.org/kkw2709/) 2 de octubre, 2018 1 reply

I could not figure out how to connect GA with CF7 – turns out it was really easy
with this plugin. Works perfectly.

![](https://secure.gravatar.com/avatar/d0d5ef467be4ae5cb9c0b3b9602f5074c95d1c53c436f233ead603919d951bef?
s=60&d=retro&r=g)

### 󠀁[Worked well, but created duplicate submit of form](https://wordpress.org/support/topic/worked-well-but-created-duplicate-submit-of-form/)󠁿

 [mittijoshi](https://profiles.wordpress.org/mittijoshi/) 8 de junio, 2018 1 reply

Worked very well. But after installing this plugin my forms were getting submitted
two times on single click.

![](https://secure.gravatar.com/avatar/81604bc8917eef05719b8ba7dafcc600d2d2eb2cc1185eb7e7b31de98021db4c?
s=60&d=retro&r=g)

### 󠀁[Great addition to CF7](https://wordpress.org/support/topic/great-addition-to-cf7-2/)󠁿

 [Erik Molenaar](https://profiles.wordpress.org/erikmolenaar/) 22 de mayo, 2018 
1 reply

Why did CF7 remove this much needed feature anyways and required a piece of code
in functions.php? This plugin is much more user friendly. It rocks! And great support
as well 🙂

 [ Read all 12 reviews ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/)

## Contributors & Developers

“Contact Form 7 Google Analytics” is open source software. The following people 
have contributed to this plugin.

Contributors

 *   [ macbookandrew ](https://profiles.wordpress.org/macbookandrew/)

[Translate “Contact Form 7 Google Analytics” into your language.](https://translate.wordpress.org/projects/wp-plugins/cf7-google-analytics)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/cf7-google-analytics/),
check out the [SVN repository](https://plugins.svn.wordpress.org/cf7-google-analytics/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/cf7-google-analytics/)
by [RSS](https://plugins.trac.wordpress.org/log/cf7-google-analytics/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.8.12

 * Update tested-up-to version.

#### 1.8.11

 * Update tested-up-to version.

#### 1.8.10

 * Fix issue with minified JS

#### 1.8.9

 * Fix undefined index issue in new installations

#### 1.8.8

 * Update tested-up-to version and automatic deployment.

#### 1.8.7

 * Fix typo in old tracking code for GTM.

#### 1.8.6

 * Fix typo in upgrade notes.

#### 1.8.5

 * Fix a bug with GTM and older CF7 versions.
 * Drop “Contact Form” event labels for some integrations, leaving just “Contact
   Form 7” as the event label.

#### 1.8.4

 * Fix a bug sending “Contact Form” instead of “Contact Form 7” as the event label
   for certain configurations.

#### 1.8.3

 * Fix a bug sending the form ID instead of name to Google Analytics.

#### 1.8.2

 * Cache form titles and IDs for better performance.
 * Remove 1.7.0 admin upgrade notices.

#### 1.8.1

 * Fix a bug causing events not to send due to upgrade logic.
 * Set default options if user has not selected events to send.

#### 1.8.0

 * Add options to enable/disable the available event actions.

#### 1.7.5

 * Update readme with goal tracking instructions

#### 1.7.4

 * Update readme with GDPR notes

#### 1.7.3

 * Add [`gtm.js` setup instructions](https://github.com/macbookandrew/cf7-google-analytics#how-do-i-use-this-with-google-tag-manager-gtmjs)
 * Update plugin coding standards

#### 1.7.2

 * Fix error with undefined constant

#### 1.7.1

 * Fix error with admin notice on PHP < 5.0

#### 1.7.0

 * Add support for all CF7 DOM events. Please [see this note for more detail](https://github.com/macbookandrew/cf7-google-analytics#what-events-will-be-shown).

#### 1.6.1

 * Add support for PHP < 5.3

#### 1.6.0

 * Add support for Google Tag Manager

#### 1.5.0

 * Add support for sending the Contact Form 7 form name instead of just the form
   ID

#### 1.4.1

 * Update suppoprt for gtag.js custom events

#### 1.4.0

 * Add support for the Global Site Tag (gtag.js)

#### 1.3.0

 * Update to use new DOM events in Contact Form 7 v4.8

#### 1.2.2

 * Fix JS issue if `ga` is undefined

#### 1.2.1

 * Fix PHP undefined index issue

#### 1.2

 * Fix issue where any manually-specified items were being deleted

#### 1.1

 * Add support for Google Analytics by Yoast

#### 1.0

 * First stable version

## Meta

 *  Version **1.8.12**
 *  Last updated **4 meses ago**
 *  Active installations **7.000+**
 *  WordPress version ** 4.3 or higher **
 *  Tested up to **6.8.5**
 *  Language
 * [English (US)](https://wordpress.org/plugins/cf7-google-analytics/)
 * Tags
 * [analytics](https://pe.wordpress.org/plugins/tags/analytics/)[contact form 7](https://pe.wordpress.org/plugins/tags/contact-form-7/)
   [google analytics](https://pe.wordpress.org/plugins/tags/google-analytics/)
 *  [Advanced View](https://pe.wordpress.org/plugins/cf7-google-analytics/advanced/)

## Ratings

 4.8 out of 5 stars.

 *  [  10 5-star reviews     ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/cf7-google-analytics/reviews/)

## Contributors

 *   [ macbookandrew ](https://profiles.wordpress.org/macbookandrew/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/cf7-google-analytics/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://cash.me/$AndrewRMinionDesign)