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?
partly that is right.
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?
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.
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 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.