Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Looking for custom script in Adobe DTM data element

Avatar

Avatar
Validate 1
Level 1
amitj723
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
amitj723
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
amitj723
Level 1

29-09-2016

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 5
Level 4
JillsMatthew
Level 4

Likes

28 likes

Total Posts

68 posts

Correct Reply

23 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 1
Validate 10
View profile

Avatar
Give Back 5
Level 4
JillsMatthew
Level 4

Likes

28 likes

Total Posts

68 posts

Correct Reply

23 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Ignite 1
Validate 10
View profile
JillsMatthew
Level 4

30-09-2016

amitj723 wrote...

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.

  1. <article class="mu-item">
  2. <a href="#">
  3. <div>
  4. <h1>This is a test text for tracking</h1>
  5. <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>
  6. </p>
  7. </div>
  8. </a>
  9. </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.

 

 

In order to get the text from <h1> tags, in your event based rule for <h1> clicks, try using %this.@cleanText% as the value for your variable (See attached screenshot)

eVar1="%this.@cleanText%"

 

Answers (1)

Answers (1)

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

93 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

30-09-2016

Hi Amit ,

 As per our understanding , you are trying to create an event based data element. Please refer the below article for creating the same :-

https://helpx.adobe.com/dtm/kb/Event_Based_Data_Element_or_pass_custom_page_data_to_Data_Element.htm...

Thanks & Regards

Parit Mittal