Specifying the id of an Image Tag

Bronze Contributor
Bronze Contributor

How can I specify the id of an img tag using one of the Tealium Custom Containers?

 

I have to implement the following tag on all page of my site.

 

<img id="_GUARANTEE_ImgTagSeal" style="display:none;" src="//nsg.symantec.com/Web/Seal/AltSealInfo.aspx?S=Large&T=M&Elem=_GUARANTEE_ImgTagSeal&HASH=mpFUcYwMbCBxgEXT3PHy240C4dUxmNQSW65TEYgddkc1W%2FAuKeDR3e2D7uAGyp2ZkDEpTjwZJT6Ttv2Z6CGOiw%3D%3D&CBF=AB&AB=1&DP=fn=;src=ImgTagSeal;grt=true" />

 

I updated the base url key in the u.data object with the source of the image tag:

 

u.data = {
/* Initialize default tag parameter values here */
/* Examples: */
/* "account_id" : "1234567" */
"base_url" : "//nsg.symantec.com/Web/Seal/AltSealInfo.aspx?S=Large&T=M&Elem=_GUARANTEE_ImgTagSeal&HASH=mpFUcYwMbCBxgEXT3PHy240C4dUxmNQSW65TEYgddkc1W%2FAuKeDR3e2D7uAGyp2ZkDEpTjwZJT6Ttv2Z6CGOiw%3D%3D&CBF=AB&AB=1&DP=fn=;src=ImgTagSeal;grt=true"
/* A value mapped to "account_id" or "base_url" in TiQ will replace these default values. */
};

 

I then uncommented the u.loader line indicating the tag was an image tage. I added "id" : '_GUARANTEE_ImgTagSeal' to the object.

 

u.loader({"type" : "img", "id" : '_GUARANTEE_ImgTagSeal', "src" : u.data.base_url + c.join(u.data.qsp_delim) });

 

When debugging, I am seeing the Tealium Custom Container loading and executing correctly with a 200 response. However, I am not seeing the tag firing.

 

I believe this is because I have implemented the required id in the object incorrectly. Is there another way to add this attribute to a custom image tag?

 

1 REPLY 1

Specifying the id of an Image Tag

Employee Emeritus

 

Hello @cale_rubenstein. In the command:

u.loader({"type" : "img", "id" : '_GUARANTEE_ImgTagSeal', "src" : u.data.base_url + c.join(u.data.qsp_delim) });

You need to have a 'c' variable as an array.  Additionally, under u.data, you need to have a keyname of qsp_delim.  I don't believe any of these are the case and as such, the code is throwing an exception which prevents the pixel from firing.

 

 

Update your call to:

u.loader({"type" : "img", "id" : "_GUARANTEE_ImgTagSeal", "src" : u.data.base_url });

This should solve your issue.

Public