Adobe Launch - how to capture link URL on a click action? | Community
Skip to main content
Level 2
Apr 24, 2024 9:26 AM UTC
Solved

Adobe Launch - how to capture link URL on a click action?

Dear community,

 

I'm rather new to Adobe Launch and therefore, probably an obvious question:

 

  • I need to track some links in a custom way in Adobe Analytics via Adobe Launch.
  • I have a rule that triggers s.tl() tracking call with custom link with a specific value
  • I see in AA debugger that the link URL is sent in the call (see picture) but I can't retrieve this in AA reporting (not part of standard variables?)
  • Therefore I would like to capture the target URL (href value) of the clicked links in custom variable 
  • How can I do this? How to create a data element that returns the value for link HREF when clicked? Custom code?

I've been working for years with GTM and there it is pretty straightforward - these are built-in variables (link text, link href,...) without any coding.

Any help would be welcome 🙂

 

Thanks.

 

Note: I have found this article: https://experienceleaguecommunities.adobe.com/t5/dynamic-tag-management-questions/how-to-track-the-click-url-through-data-element-and-pass-to/m-p/280998 but it looks outdated (old DTM interface)

 

pradnya_balvir
pradnya_balvirAccepted solution
New Participant
Apr 25, 2024 1:13 PM UTC

Go to Your Web Property

Create a Rule

Add event type Click 

Add specific element, add CSS selector value for that link (example for anchor a)

Define your variable eVar/prop for URL

example eVar1 is for URL

In set variable eVar1 = %this.href%

If needed I can share screenshots for more clarification.

 

8 replies

Level 2
Apr 30, 2024 9:19 AM UTC

Hi,

Thank you all for the feedback. It worked! (of course it did, so simple once you know it ;-))

And the cheat sheet is very handy.

You made my day.

 

Regards,

Michael

Translate
pradnya_balvir
New Participant
Apr 30, 2024 11:35 AM UTC

Thanks @michaelnotte for the update.

Translate
pradnya_balvir
pradnya_balvirAccepted solution
New Participant
Apr 25, 2024 1:13 PM UTC

Go to Your Web Property

Create a Rule

Add event type Click 

Add specific element, add CSS selector value for that link (example for anchor a)

Define your variable eVar/prop for URL

example eVar1 is for URL

In set variable eVar1 = %this.href%

If needed I can share screenshots for more clarification.

 

Translate
Jennifer_Dungan
Level 2
Apr 25, 2024 1:43 PM UTC

I don't think that worked when Launch was first launched, but I can confirm this does work!

 

But if you need to do any manipulation or logic checks on the value, custom code is still needed. But it sounds like you are using a straight pass-through @michaelnotte so this should be sufficient for your needs.

Translate
Employee
Apr 24, 2024 10:21 AM UTC

Hi @michaelnotte if you use Custom Code in the Action of the Rule, you can access two variables:

- event: that is the JS object of the event triggered. "event.target" is the DOM object where you clicked and from there you can retrieve the URL

- this: is the DOM object you clicked (like the event.target) and from there you can retrieve the URL from the href.

 

Hope this helps.

 

 

Translate
Jennifer_Dungan
Level 2
Apr 24, 2024 4:31 PM UTC

To back this up, I do myself use custom code "this.href" to pass the url of the clicked element into my parameters....

 

However, it may be possible to get this with a "DOM Attribute" Data Element?

 

 

 

I have not tested this, but if you use the same CSS Selector as you are using for your click, it might pick up the value, or it might grab the first matched element.

 

This is why I've always used the custom code method, because I am sure it's exactly what I need..... 

Translate