Expand my Community achievements bar.

Announcement: Calling all learners and mentors! Applications are now open for the Adobe Analytics 2024 Mentorship Program! Come learn from the best to prepare for an official certification in Adobe Analytics.

s.tl link object

Avatar

Level 2

I want to create link tracking using the below

s.tl(this,'o','Flow Overlay');

My developer is asking if they can replace the link object value of 'this' with 'document'.

I'm pretty new to Adobe and can only see references in Adobe documentation to using 'this' or 'true' as the link object value.

Can anyone explain what the ramifications might be of using 'document' instead?

5 Replies

Avatar

Community Advisor

Can I ask if you are using Launch? Or self-hosted AppMeasurement.js? In most cases you shouldn't need to trigger your action beacons manual (I say this knowing that I have stuff like that built into custom code in my implementation)..

 

Anyway, I don't think the "this" or "true" or "document" makes much difference to a custom link... I took that literal code and ran it in my browser's console. The action triggered like any other... I didn't see any issues or missing data, so you should be fine.

Avatar

Level 2

Great - thanks Jennifer. Your response supports what we were thinking.

Avatar

Community Advisor

Honestly, I think the "this" is more for exit links... I think this is what grabs the url from the link to populate into pev1, which isn't used on a custom link.... because the link name (pev2) is used instead.

Avatar

Level 8

interesting, I have never really thought about this, but this is what the documentation says about whether to use this or true.

a typical bad example of untyped javascript functions, when the first parameter can be a DOM element or a boolean...

 

I would assume that passing in the "document" will likely behave similar to using this.

 

// Include a 500ms delay with an exit link
s.tl(this,"e","Example exit link");

 

bjoern__koth_0-1719333951527.png

 

Avatar

Community Advisor

I find it funny that this is still sending "Example exit link" but that won't show in any reports, lol

 

Once something is marked as an exit link, the pev1 value  (the url) gets placed into the "Exit Links" dimension, and the "Custom Links" dimension doesn't get that value..... 

 

On the other hand, if the link is custom, even if both pev1 and pev2 are sent, only the linkname in the pev2 are available in the interface... 

 

I guess if you are using Raw Data feeds you would have access to both... 

You can also force the pev1 value using s.linkURL (I was playing with a solution for an exit button where the actual URL couldn't be seen)