WordPress.org

Support

Support » Plugins and Hacks » Contact Form 7 » Even tracking for form submission doesn't work

Even tracking for form submission doesn't work

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Takayuki Miyoshi

    @takayukister

    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

    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.

    Plugin Author Takayuki Miyoshi

    @takayukister

    So how have you set up?

    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Even tracking for form submission doesn't work’ is closed to new replies.
Skip to toolbar