WordPress.org

Forums

Contact Form 7
Even tracking for form submission doesn't work (5 posts)

  1. wallaroomedia
    Member
    Posted 1 year ago #

    Hi,

    I follow all the instruction I can find on your website about this issue. I set it up as directed, and the form submission/email works fine. However, on my Google analytic account, there is no event that has been recorded. Here is the url to the form on my website: http://mwranches.com/property-brochure/

    Thank you for your help and your time.

    https://wordpress.org/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    Try deactivating all other plugins and switching to the default theme.

    BTW has this been resolved?
    http://wordpress.org/support/topic/form-submission-to-fail-because-of-google-tracking-code-in-additional-settings

  3. wallaroomedia
    Member
    Posted 1 year ago #

    The other issued was resolved. I tried deactivating other plugins and switching to the default theme. The email sent out fine but the Google Analytic didn't record any events.

  4. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 1 year ago #

    So how have you set up?

  5. wallaroomedia
    Member
    Posted 1 year ago #

    First, I put this script onto the header.php of the theme:

    <script type="text/javascript">

    var _gaq = _gaq || [];

    _gaq.push(['_setAccount', 'UA-41929640-1']);

    _gaq.push(['_trackPageview']);

    (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);

    })();

    </script>

    Then in the Additional Settings of the contact form, I put this line of code in:

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

    And the title of my contact form is Brochure Request Form.

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