Contact Form 7
GA Event Tracking doesn't work (5 posts)

  1. sinansaglam
    Posted 2 years ago #


    we're trying to implement Google Analytics tracking for the Contact Forms on our website, but it doesn't work.

    We already tried those codes:

    on_sent_ok: "_gaq.push(['_trackEvent', 'Contact', 'Lead', 'Contact Form']);"
    on_sent_ok: "_gaq.push(['_trackPageview', '/kontakt/danke/']);"

    And the GA code: (with ID changed)

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'XX-XXXXXXX-X']);

    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


    The goals ar set up properly. We don't know what to do to get it working...

    Can anyone help us?

    Thank you so much,
    Sinan Saglam


  2. Takayuki Miyoshi
    Plugin Author

    Posted 2 years ago #

    Can I see your site?

  3. sinansaglam
    Posted 2 years ago #

    Yes, totally forgot to post the link:


  4. Takayuki Miyoshi
    Plugin Author

    Posted 2 years ago #

    On the page, AJAX submission is not working.

    See Why isn’t My AJAX Contact Form Working Correctly?

    When AJAX submission doesn't work, on_sent_ok JavaScript hook doesn't work, neither.

  5. treatment
    Posted 2 years ago #

    I am having the same issue. I have set up event tracking in the Additional Settings field as such -

    on_sent_ok: "_gaq.push(['_trackEvent', 'Contact Form', 'Submit', 'For a Loved One']);"

    I have set up the goals in the account yesterday. Does it take longer than 24 hours to properly set up? My site is "thebestrehabs.com" if you could look into it.

    I look forward to your reply.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic