Read event output variables from extension in the tag templates

Bronze Contributor
Bronze Contributor

I created a link tracking extension (event name = link_click). I created a tag to fire when the event_name = link_click. It is tag which is not present in the martket place. So I added a Tealium custom container tag and editted the template in the /* Start Tag Library Code */ section with the tags our vendor has provided. One of the lines of code requires the url of the link clicked. From what I understand, this is available as link_url which is an event output variable. I am unable to figure out how to read this and assign it to the variable in the template. Can you please help with this? Thanks


Read event output variables from extension in the tag templates

Gold Contributor
Gold Contributor

Hi @harshini. Ok from what I understand you want to implement a custom tag which is not available in the marketplace and in order for that tag to fire it needs to have the URL of the link which was clicked. Thereby implying that the tag should only fire on-click and not on page load.


First of all, the Tealium Generic tag and pixel container are there only to fire a given pixel or script on the site. You cannot edit the template of this tag with vendor given JS as it would only break the system and not work. Therefore I suggest that you have a look at the vendor documentation and test out the script on your local machine. Thereafter setup the generic tag to fire the particular pixel which you need to pass.


However if you want to fire this pixel on click of a button or link, then I suggest you to use a JavaScript extension and write a bit of code to bind to the link click event and thereafter fire the pixel or execute the script manually using a bit of JavaScript.


Read event output variables from extension in the tag templates

Tealium Employee



I would suggest reviewing these articles.


So as a TLDR:


/* Start Tag Library Code */
/* End Tag Library Code */

This is for code that runs as soon as the tag has loaded


You should add your code you want to use to this section:

/* Start Tag Sending Code */
  // Insert your tag sending code here.
/* End Tag Sending Code */


Then at this point you can access mappings that have occured in .



Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.