联系表单7 - Google Analytics(分析)跟踪 [英] Contact form 7 - Google Analytics Tracking
问题描述
我试图用联系表格7跟踪谷歌分析中提交的联系表格。
我尝试了以下方法:
-
我放置了代码
on_sent_ok:ga('send','event','Contact Form','submit' );其他设置中的
不起作用。此方法支持到2017年底。新方法是DOM事件,所以...
...我用DOM事件试了一下。我放置了代码
< script>
document.addEventListener('wpcf7mailsent',function(event){
ga('send','event','Contact Form','submit');
},false);
< / script>
我还尝试了一个WordPress插件Contact Form 7 Google Analytics(分析联系表格7),以及这也不管用。无论我尝试哪种方式:网站不会执行此行:
ga('send','event','Contact Form ','submit');
没有事件出现在Google的实时视图中分析。
几个月前我遇到了这个问题( Wordpress和Google Analytics活动) )但这是一个新的网站,我认为这是同样的问题。必须有理由?
你可以找到我正在谈论的新网站在这里。
我对任何帮助感到非常高兴。谢谢!
编辑:新提示:
提交表单后没有谢谢你的留言。没有任何反应,网址更改为 http://page.xyz/kontakt/#wpcf7 -f4-p18-o1
我认为这是不正常的?
您可能想要请尝试使用联系表格7 Google Analytics智能插件, https://wordpress.org/plugins/cf7-intelligence 。它使包括目标创建在内的整个过程自动化。
I`m trying to track submitted contact forms in google analytics with contact form 7. I tried the following:
I placed the code
on_sent_ok: "ga('send', 'event', 'Contact Form', 'submit');"
in the additional settings. Does not work. This method is supported until the end of 2017. The new method is "DOM events", so...
...I tried it with DOM events. I placed the code
<script> document.addEventListener( 'wpcf7mailsent', function( event ) { ga('send', 'event', 'Contact Form', 'submit'); }, false ); </script>
in the head of the template. Also, does not work.
I also tried a WordPress plugin "Contact Form 7 Google Analytics" and this doesn´t work either. No matter which way I tried: The site doesn´t execute the line:
ga('send', 'event', 'Contact Form', 'submit');
No event appears in the live view of google analytics. I had this problem a few months ago (Wordpress and Google Analytics Events) but this is a new site and i think it`s the same problem. There must be reason?
You can find the new site I am talking about here.
I am really happy about any help. Thank you!
Edit: New hint: After submitting a form there is no "thank you message". Nothing happens an the url changes to http://page.xyz/kontakt/#wpcf7-f4-p18-o1 I think this is not normal?
You might want to try the Contact Form 7 Google Analytics Intelligence plugin, https://wordpress.org/plugins/cf7-intelligence. It automates the whole process including goal creation.
这篇关于联系表单7 - Google Analytics(分析)跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!