在Google AMP分析事件跟踪中传递动态事件标签 [英] Pass dynamic event label in Google AMP analytics event tracking

查看:152
本文介绍了在Google AMP分析事件跟踪中传递动态事件标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的AMP html页面上点击链接时使用Google Analytics分析事件。此外,我想在跟踪此事件时将链接(href)作为eventLabel传递。有没有办法将链接URL设置为data- *属性,然后可以将其传递给Google Analytics事件跟踪脚本。或者还有其他方法可以做到这一点。

这是非常标准的事情,但Google Analytics for AMP页面不包含它。

解决方案

我想你最近提出的要求是这里


$ b $基本上,你可以使用如下代码:

 < span id =test1class =boxdata-瓦尔-事件标签= 22 >点击此处< / span> 

,然后使用配置中的值作为 $ {eventLabel} code>


I want to track an event with google analytics when a link is clicked on my AMP html page. Also I want to pass the link(href) as eventLabel while tracking this event. Is there a way to set the link URL as data-* attribute which then can be passed to google analytics event tracking script. Or is there any other way to do this.

This is pretty standard thing but Google Analytics for AMP page doesn't cover it.

解决方案

I think what you are asking for was recently made available here.

basically, you can use code like

<span id="test1" class="box" data-vars-event-label="22"> Click here </span>

and then use the value in the configuration as ${eventLabel}

这篇关于在Google AMP分析事件跟踪中传递动态事件标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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