Title: Google Analytics snippet breaks Ajax functionality
Last modified: August 22, 2016

---

# Google Analytics snippet breaks Ajax functionality

 *  [bozon](https://wordpress.org/support/users/bozon/)
 * (@bozon)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/google-analytics-snippet-breaks-ajax-functionality/)
 * Hi!
 * I’ve noticed that on my WordPress installation when I add this snippet
 * `on_sent_ok: "_gaq.push(['_trackEvent', 'Contact Form', 'Submit']);"`
 * in the ‘Additional Settings’ field Ajax notifications about successful or failed
   message sending stop appearing.
 * On the web you can find a ‘solution’, change line 10 of wp-content/plugins/contact-
   form-7/includes/js/scipts.js from:
 * `$('div.wpcf7 > form').wpcf7InitForm();`
 * to
 * `$('div.wpcf7-form > form').wpcf7InitForm();`
 * but this is a bad solution since it breaks Ajax functionality completely and 
   the whole page reloads.
 * Any suggestions how to fix this?
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/google-analytics-snippet-breaks-ajax-functionality/#post-5440058)
 * Where can I see the form?

Viewing 1 replies (of 1 total)

 The topic ‘Google Analytics snippet breaks Ajax functionality’ is closed to new
replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)

 * 1 reply
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/google-analytics-snippet-breaks-ajax-functionality/#post-5440058)
 * Status: not resolved