[英]Contact form 7 - Google Analytics Tracking
I`m trying to track submitted contact forms in google analytics with contact form 7. I tried the following: 我正在尝试使用联系表单7跟踪Google Analytics(分析)中提交的联系表单。我尝试了以下操作:
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...
该方法受支持到2017年底。新方法是“ DOM事件”,因此...
...I tried it with DOM events. ...我尝试了DOM事件。 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. 我还尝试了一个WordPress插件“ Contact Form 7 Google Analytics”,但这也不起作用。 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.
几个月前我遇到了这个问题( Wordpress和Google Analytics(分析)活动 ),但这是一个新站点,我认为这是同样的问题。 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?
没有任何反应,网址更改为http://page.xyz/kontakt/#wpcf7-f4-p18-o1我认为这不正常吗?
How did you set up event in google analytics? 您是如何在Google Analytics(分析)中设置活动的? Maybe you need to pass a value in ga function.
也许您需要在ga函数中传递一个值。
If you set a value to 0 here and its "Greater than" selected, then you have to pass a value of '1' in ga send function. 如果您在此处将值设置为0并选择了“大于”,则必须在ga send函数中传递值“ 1”。
You might want to try the Contact Form 7 Google Analytics Intelligence plugin, https://wordpress.org/plugins/cf7-intelligence . 您可能要尝试使用Contact Form 7 Google Analytics Intelligence插件https://wordpress.org/plugins/cf7-intelligence 。 It automates the whole process including goal creation.
它使包括目标创建在内的整个过程自动化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.