Highlighted

Is it possible to pass the clicked text through DoubleClick tag

Rookie Contributor
I have a DoubleClick tag capturing when documents are clicked and opened on our site. I want to find out is there a way to capture the text that is being clicked. Is there a way to use the Set Data Values Extension to do this? Example: Someone comes to the site and clicks the document "Document ABC" to download it. I'd want to map "Document ABC" to be the u4 for that DoubleClick tag. Thanks in advance!
2 REPLIES 2
Highlighted

Is it possible to pass the clicked text through DoubleClick tag

Tealium Employee
Hey Dustin, Are you using a jQuery onHandler or clickHandler extension to fire the tag on click? If so, you can add an extra data source as part of the configuration that uses jQuery to pull the text of the clicked link and pass it along, utilizing the following code (assuming that the jQuery selector is the anchor link to the pdf): jQuery(this).text() From there, you would then just map that data source to the u4 value in the DoubleClick tag configuration mapping toolbox. Following this answer is an image of what that would look like, where I created a new data sourced called pdf_text and am using jQuery in the JS field to achieve the above. pdf_text would then be mapped to u4 in DoubleClick Floodlight.
Highlighted

Is it possible to pass the clicked text through DoubleClick tag

Bronze Contributor
Bronze Contributor
If you have jQuery onHandler extension then you can use jQuery(this).attr('text') on the page where the link exists to get the text and add to data layer on click event, and then pass it to doubleclick. You have to wait for the click event to occur for the value to be available.