在adobedtm数据元素中寻找自定义脚本

Looking for custom script in Adobe DTM data element?

本文关键字:寻找 自定义 脚本 元素 adobedtm 数据      更新时间:2023-09-26

我试图在DTM中捕获HTML文本值。有一个物品标签,上面有卡片的详细信息。一旦用户点击卡片,将报告卡片(h1)标签的名称。下面是我的代码片段。

<article class="mu-item">
  <a href="#">
    <div>
      <h1>This is a test text for tracking</h1>
      <p>This was the day when the South Stand at Old Trafford, the stadium where he played around half of his 758 matches for United, was officially renamed in his honour before his beloved Reds took on Everton in the Barclays Premier League.<br><br>
</p>
    </div>
  </a>
</article>

我已经尝试创建基于事件的规则与数据元素,但没有工作正常。谁能告诉我正确的方向?我是否需要创建一个数据元素。我应该在我的data元素中定义什么?我必须使用DTM自定义脚本吗

你可以创建一个新的"data元素"使用css选择器类型,把css选择器链

在本例中,我将使用以下css选择器作为示例。

.mu-item div h1 

现在在"get the value of"选项中选择"text",并保存更改

应该可以。