简体   繁体   English

点击 Google Tag Manager 和 Google Analytics Conversion 上的元素跟踪

[英]Click Element Tracking on Google Tag Manager & Google Analytics Conversion

I have a banner with 3 images on my homepage.我的主页上有一个包含 3 张图片的横幅。 I want to track how many people are clicking on one of the image (The specific one) as a conversion on Google analytics.我想跟踪有多少人点击其中一张图片(特定图片)作为 Google 分析的转化。 I am planning to use Tag manager trigger to capture this action.我打算使用标签管理器触发器来捕获此操作。

I have added a specific ID called "ciaBannerHome"我添加了一个名为“ciaBannerHome”的特定 ID

On the Tag Manager triggered, I have the setting below,在触发的跟踪代码管理器上,我有以下设置,

However, it is not capturing when people is clicking on the banner.但是,当人们单击横幅时,它不会捕获。

在此处输入图像描述

Below is what is showing on output variables on Google Tag Manager:以下是 Google 跟踪代码管理器上 output 变量的显示内容:

在此处输入图像描述

An Element is not a string, it's an object. Therefore, an Element doesn't typically 'contain'.元素不是字符串,它是 object。因此,元素通常不“包含”。 Elements usually match CSS-selectors.元素通常匹配 CSS 选择器。 So change the contain condition to the match CSS-selector one.所以将包含条件更改为匹配 CSS-selector 之一。

In the value of the Click Element the debugger shows you a very precise CSS selector for it rather than the value of the element.在 Click Element 的值中,调试器会为您显示一个非常精确的 CSS 选择器,而不是元素的值。 An Element object is usually quite large to show here.元素 object 通常很大,无法在此处显示。 Also, the preview usually doesn't stringify objects to show the values.此外,预览通常不会将对象字符串化以显示值。 And not every object can be stringified anyway.并不是每个 object 都可以被字符串化。

In your case, a CSS selector to match would be #ciaBannerHome where # indicates that "ciaBannerHome" is the id of the to-be-clicked element.在您的情况下,要匹配的 CSS 选择器将是 #ciaBannerHome,其中 # 表示“ciaBannerHome”是要单击的元素的 ID。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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