Custom code to track link name in adobe launch. | Community
Skip to main content
Level 5
February 20, 2023
Solved

Custom code to track link name in adobe launch.

  • February 20, 2023
  • 1 reply
  • 3769 views

I know how to track link click using click event  using css selector in adobe launch. But I am trying to get a custom code that can be used in adobe launch to listen for link click and then get link name from that link and store it in evar and prop and custom link name. Can somebody throw a code just link that? Actually I am challenging myself to make use of custom js code.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by FrederikWerner

Personally, I would always try to avoid Custom Code. While you can just use

return event.element.innerText;

as Custom Code, doing it within a Data Element in the UI is much clearer and more accessible to many users. It's a personal preference, but going the UI-route has always payed off for me.

1 reply

FrederikWerner
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 20, 2023

With the click event, information about the clicked element gets attached to the Event Object automatically. From there, it is very easy to pick up using a Constant Data Element. The innerText attribute might be the right one for your use case, which can be accessed as "%event.element.innerText%":

It's also featured in this tutorial I've done a while back, you can find the video here: https://youtu.be/VRi3WdwkA3g?t=513

Learn more about Adobe Analytics and Customer Journey Analytics on my blogNeed help with Adobe Analytics or Customer Journey Analytics? Let's talk!
aagk123Author
Level 5
February 20, 2023

Wow man send me more such videos so that I can get comfortable using custom codes.

FrederikWerner
Community Advisor and Adobe Champion
FrederikWernerCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
February 20, 2023

Personally, I would always try to avoid Custom Code. While you can just use

return event.element.innerText;

as Custom Code, doing it within a Data Element in the UI is much clearer and more accessible to many users. It's a personal preference, but going the UI-route has always payed off for me.

Learn more about Adobe Analytics and Customer Journey Analytics on my blogNeed help with Adobe Analytics or Customer Journey Analytics? Let's talk!