Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Bronze Contributor
Bronze Contributor
When a data source is mapped to a prop and eVar, Tealium IQ would automatically map the value to the prop variable and set a dynamic variable for the eVar. Is there a way to switch this around and have the value map to the eVar and set the dynamic variable against the prop? For example instead of prop1="My Value" eVar1="D=c1" I want prop1="D=v1" eVar1="My value" Thanks
6 REPLIES 6

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Employee Emeritus
Leslie it would be possible to do this but only by altering the tag template. Can you please explain the reason for changing it round? There might be an alternative solution to achieve what you're looking for.

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Bronze Contributor
Bronze Contributor
We've keyed our omniture implementation around eVars, and we have some integration that only looks for the eVar variables in the s object. This is by no means a good practice but it is the way it is, so I'm trying to figure how to switch the dynamic variables around at tealium's end, instead of going through all our sites to "fix" the integration. Pardon my ignorance but what is the tag template? I'm still new to tealium. Thanks for your time Leslie

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Employee Emeritus
Hey Leslie, Try this out: Add a JavaScript Code Extension Give it a title like : Dynamic Variable List - SiteCatalyst Paste in the following: {code:javascript} u.varlist={ pageName:'pageName', channel:'ch', campaign:'v0', hier1:'h1', hier2:'h2', hier3:'h3', hier4:'h4' }; for(var i=1;i<76;i++){ u.varlist['eVar'+i]='v'+i; u.varlist['prop'+i]='c'+i;} ; {code} Scope this extension to the SiteCatalyst tag. Save/Publish Usually props are evaluated first then eVars will be set to match. This is why you get the eVars with the "D=" notation. However, the above will switch the order so eVars are evaluated first and props will then have the "D=v#" notation instead of eVars. Please let us know how this works for you. It seemed to do the trick in my sandbox. Also, a tag template is a JavaScript file on the Tealium backend that has all the logic for the tag vendor. Each tag has it's own template. The templates are what configure the proper data and trigger the server calls for each vendor.

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Employee Emeritus
A tag template is the code that we serve into your web pages. It contains the standard code supplied by the vendor, plus some integration logic supplied by Tealium that makes it work inside our system. The SiteCatalyst template contains the standard code from "below the line" in the s_code.js file, plus integration code that sends the data to the right props and eVars as listed in your tag mappings. If you are reading from the 's' object directly, then the long term fix would be to update the integration code so that reads from your data layer (utag_data) instead. The best short term fix would be to remove the mapping on the props. So if you have a data variable utag_data.page_type, then have a mapping from page_type to eVar1 but not prop1. You can then create a JavaScript Code extension with this logic in it: {code:js} var s_doPlugins = function (s) { s.prop1 = "D=v1"; }; s.doPlugins = s_doPlugins; {code} If you have an extension containing doPlugins() already, you will need to merge this code into it. Your Service Manager can help you to create the extension.

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Employee Emeritus
Jared, thanks for that suggestion. Looks like your code got a little mangled though, can you edit it please? If there are several props mapped to equivalent eVars, your loop suggestion would work great. You could also use it inside doPlugins like this: {code:js} var s_doPlugins = function (s) { var propList = [1, 2, 3, 4, 20, 21, 22]; for (var i = 0; i < propList.length; i++) { var n = propList[i]; s["prop"+n] = "D=v"+n; } }; s.doPlugins = s_doPlugins; {code} This would map prop1 to evar1, prop2 to evar2, prop3 to evar3 and so on.

Tealium IQ would automatically set the dynamic variable to the eVar, can we set it against the prop instead?

Employee Emeritus
That's the best formatting possible :) The u.varlist suggestion is directly out of the SiteCatalyst tag template with a slight change. There is additional code in the template that, as you suggest, maps the props to eVars or eVars to props.
Public