Forums

[resolved] [Plugin: Contact Form 7] Ajax notices disappear when adding multiple on_sent_ok (2 posts)

  1. gillespieza
    Member
    Posted 1 year ago #

    I'm trying to add Google AdWords conversion tracking AND Google Analytics tracking to Contact Form 7 on successful submit.

    I have the following code in Additional settings:

    on_sent_ok: "jQuery(String.fromCharCode(60)+'img/'+String.fromCharCode(62)).attr('height','1').attr('width','1').css('border-style','none').attr('src','http://www.googleadservices.com/pagead/conversion/'+google_conversion_id+'/?value='+google_conversion_value+String.fromCharCode(38)+'label='+google_conversion_label+String.fromCharCode(38)+'guid=ON'+String.fromCharCode(38)+'script=0').appendTo('body');"
    on_sent_ok: "pageTracker._trackPageview('/contactform/thankyou.html');"

    If I just have the first on_sent_ok hook, I get the Ajax notifications just fine. As soon as I add the second on_sent_ok, the notices disappear...

    Are they meant to be one 1 line, maybe?

  2. gillespieza
    Member
    Posted 1 year ago #

    Turns out it was not a problem with Contact Form 7, but a javascript error with Google Analytics. PageTracker was never defined properly (ended up using on_sent_ok: "_gaq.push(['_trackPageview', '/thank-you.html']);" instead.

Topic Closed

This topic has been closed to new replies.

About this Topic