Putting tracked link name and url into eVars

Avatar

Avatar
Validate 1
Level 1
jcaponi
Level 1

Like

1 like

Total Posts

23 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
jcaponi
Level 1

Like

1 like

Total Posts

23 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
jcaponi
Level 1

05-01-2021

I am building Launch Data Elements and a rule to capture modal-window opens on one of my sites.

I have a event to register the click that opens the modal, and in the Adobe Experience Cloud debugger I see the event, the link_o Link Type, and correct data in the Link Name and Link URL fields.

I'd also like to put the Name and URL into eVars.

I created the eVars in the Report Suite admin, and Data Elements in Launch. 

For Link URL, for instance, I have this custom code in the data element:

return(s.linkURL);

and for Link Text (alot of html is coming in there between the <a> and </a>), so I'm trying

return(s.linkName.textContent);

And I use those elements to populate the eVars in the event Rule

However, I don't see this data in the debugger or in Reporting.

I should note that the links are selected based on a class ( there are many on the page) but Link Text and Link URL does populate correctly.

How can I transfer that data to two eVars? Thanks very much.

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

200 likes

Total Posts

606 posts

Correct reply

121 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile

Avatar
Publish 1
MVP
yuhuisg
MVP

Likes

200 likes

Total Posts

606 posts

Correct reply

121 solutions
Top badges earned
Publish 1
Affirm 100
Springboard
Bedrock
Validate 1
View profile
yuhuisg
MVP

05-01-2021

Does the AA "s" object have those linkUrl and linkName properties? I don't recall seeing them before.

Fortunately, you're using Adobe Launch, so there are some "shortcuts" that you can use.

First, grab the Launch cheat sheet, if you haven't already: https://jimalytics.com/wp-content/uploads/2017/11/Adobe-Launch-Cheat-Sheet.pdf

When you use a Click event, Launch provides a "this" object that is the DOM element of the clicked element. So, you can use these to set your eVars:

eVarxx: %this.@cleanText% <-- to set link text eVar

eVaryy: %this.href% <-- to set link URL eVar

No complicated custom code needed!

Answers (0)