Looking for custom script in Adobe DTM data element?

只谈情不闲聊 提交于 2019-12-25 08:26:17

问题


I am trying to capture HTML text value in DTM. There is a article tag which has the detail of the card. Once the User clicks on the card, the name of card (h1) tag will be reported. Below mentioned my code snippet.

<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>

I have tried creating event based rule with data element but nothing is working fine. Can anyone please provide the right direction. should i have to create a data element or not. What should i define in my data element. do i have to use DTM custom scripts.


回答1:


You can do that creating a new "data element" and using the css selector type, the, put the CSS Selector Chain

in this case I will use the following css selector for example.

.mu-item div h1 

Now select "text" in the "get the value of" option, and save changes.

It should work.



来源:https://stackoverflow.com/questions/39777917/looking-for-custom-script-in-adobe-dtm-data-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!