I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Gold Contributor
Gold Contributor
 
5 REPLIES 5

I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Tealium Employee
Hi, It depends on what the function does, and where it's being set up. If I understand correctly, you have a value in a query string and if that value is present you want an extension to call the function to decode or encode that value? Is that correct? Many thanks Steve Lake
Connecting data systems since the 1980s.

I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Gold Contributor
Gold Contributor
Hi Steve, partly that is right. So we have already injected a javascript code onto the site which encodes/decodes the value which are being passed into the tealium object. So to call this function to get the decoded value we need to use the following - tealiumUtil.decode(â ENTER IN THE STRING WHICH NEED TO BE DECODESâ ); So i want to use the above function call in an extension so that it will automatically give the decoded value of a string and assign it to a variable and will be passed to GA. Can it be done this way?

I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Tealium Employee
Yes, so if you create the UDO variable that you want to pass to GA, and map it. Then in a Set Data Values extension, scoped to GA, pick that variable and set it to "js code" of tealiumUtil.decode('whatever you want to decode'); If the text that you want to decode is already a variable rather than something hard coded, then set the jscode to tealiumUtil.decode(variable); That should be all you need to do. Thanks Steve Lake
Connecting data systems since the 1980s.

I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Gold Contributor
Gold Contributor
Hi Steve, we have created a data variable as parentUrl which is a query string parameter. We have used a Set Data Values extension and in that used another variable to store the value of - decodeURIComponent("%2f"); but here "%2f" is the static input and would not cover for any other value if tomorrow prentUrl value comes other than %2f We want to use such extension which will pick the value of query string parameter dynamically. because decodeURIComponent(parentUrl) is not working for me if i want to use the variable in that command. How can i do that?

I am receiving an encoded value in page URL. a java script is injected in the code to decode/encode a value. How do I set up a call to that function through tealium extension?

Tealium Employee
I think this is probably best if you raise it as a support case then we can take a detailed look at the configuration. Either email your normal support address, or talk to your account manager. Many thanks Steve Lake
Connecting data systems since the 1980s.
Public