简体   繁体   中英

Using on_sent_ok multiple times in Wordpress Contact Form 7

The Contact Form 7 plugin for Wordpress allows additional settings to be included. I currently use on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit');" to track goal conversions in GA (Google Analytics) which works very well, however I need to also add Facebook Pixel conversion tracking to this, the issue is when adding in on_sent_ok: “fbq('track', 'Lead');” the form then does not return the sent message and clear the form, it does still send. I have tried moving the 'submit' to trigger the message to the end but it still does not work.

Is there anyway I can write aa function that will allow me to achieve this?

Add them to the same event:

on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit'); fbq('track', 'Lead');"

Also, watch out for curly quotes...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM