Highlighted

Read event output variables from extension in the tag templates

Rookie 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

2 REPLIES 2
Highlighted

Read event output variables from extension in the tag templates

Silver Contributor
Silver 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.

 

Highlighted

Read event output variables from extension in the tag templates

Tealium Employee

@harshini

 

I would suggest reviewing these articles.

 

https://community.tealiumiq.com/t5/iQ-Tag-Management/SERIES-Tealium-iQ-Custom-Container/ta-p/9498

https://community.tealiumiq.com/t5/iQ-Tag-Management/Tealium-Custom-Container/ta-p/14015

 

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 u.data .

 

Adrian

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