Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

andreassoegaard on "[Plugin: Contact Form 7] Track Google Analytics event only if a checkbox is checked"

$
0
0

Hello everybody,

I want to track an event to my Google Analytics when an e-mail is sent from a Contact Form 7 form, but ONLY if a checkbox has been checked within the contact form.

How is this possible?

I tried with following code, but it didn't really work (the ID of the checkbox is #tam):

on_sent_ok: "if ($('#tam').is(':checked')){_gaq.push(['_trackEvent', 'Nyhedsbrev', 'Kontaktformular tilmelding'])}"

Do you have any ideas? Thanks in advance!

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


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>