【发布时间】:2017-04-25 06:53:21
【问题描述】:
我遇到了问题,似乎无法让 GTM 专门注册该事件。
这是当有人点击它时我需要注册的元素的 HTML 外观。
<div class="targetDiv option option-hoverable">
<div class="shape">
<svg width="140" height="140" viewBox="0 0 140 140" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>Shape + Shape + Shape</title>
<desc>Created with Sketch.</desc>
<g transform="translate(0 0)" sketch:type="MSShapeGroup" fill="none">
<circle id="Shape" fill="#CFDF80" cx="40" cy="84.434" r="40"></circle>
<circle id="Shape" fill="#FDE9E8" cx="80" cy="40" r="40"></circle>
<circle fill="#E2506E" cx="100" cy="100" r="40"></circle>
</g>
</svg>
</div>
<h3>Product Title</h3>
<div class="actions">
<a class="button button-subtle button-toggle" data-colors="tender" data-toggled="Select" href="">Select</a>
</div>
</div>
我无法在外部 DIV 单击上注册单击,它会在按钮单击或形状上单击时注册。我需要它在具有类 targetDiv 的 DIV 上注册。
我从其他地方得到了正确的点击触发器,所以收听不是问题。
现在触发器是这样设置的:
触发器类型 - 点击 - 所有元素
触发器会在某些点击时触发。
条件是:
点击元素 -> 匹配 CSS 选择器 -> targetDiv
【问题讨论】: