Onclick事件跟踪Google Analytics(分析)Wordpress Visual Composer插件 [英] Onclick Event Tracking Google Analytics Wordpress Visual Composer Plugin

查看:348
本文介绍了Onclick事件跟踪Google Analytics(分析)Wordpress Visual Composer插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为GA事件追踪添加以下代码:

I'd like to add this code for GA event tracking:

onclick="ga('send', 'event', { eventCategory: 'Contact', eventAction: 'ContactRequest'});"

本次付款行动

<div class="vc_btn3-container vc_btn3-center vc_custom_1477135392137"><a class="vc_general vc_btn3 vc_btn3-size-md vc_btn3-shape-rounded vc_btn3-style-modern vc_btn3-block vc_btn3-color-grey" href="http://davidetaraborrelli.it/contatti/" title="" target="_blank">CONTATTAMI</a></div>

然而,我不知道如何在Wordpress中做到这一点,我的编码知识仅限于从头开始编写一个简单的页面,在这种情况下,我只需在HREF后添加一段代码。

However, I don't know how to do it in Wordpress, my knowledge of coding are limited to coding a simple page from scratch, in that case I would simply have added the piece of code after HREF.

由于此页面使用Visual Composer,因此我不知道如何

Since this page uses Visual Composer I don't know how to add that onclick piece of code to that div.

任何帮助真的很感激,我希望它是有道理的。

Any help is really appreciated, I hope it makes sense.

感谢您!

推荐答案

看起来您想在Visual Composer的CTA按钮上添加此跟踪代码。 Visual Composer提供了高级点击动作选项。你可以使用它。这是相当直接的。看看下面的截图。

Looks like you want to add this tracking code on a CTA button in Visual Composer. There is this Advanced on click action option that Visual Composer provides. You can use that. It is fairly straight forward. Check out the following screenshot.

编辑:此解决方案已在Visual Composer版本 4.12 上进行测试,如果您的版本较旧,则可能无法使用。

This solution is tested on Visual Composer version 4.12, may not work if you have an older version.

这篇关于Onclick事件跟踪Google Analytics(分析)Wordpress Visual Composer插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆