- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
10-11-2020 09:28 PM
Hi guys,
I am trying to replace a specific string using the Set Data values extension. I think the code I am using is correct but it doesn't seem to be working.
The JS code that I am using to replace the string is as follow:
b['page_name'].replace('undefined','abcd');
Any ideas why the above isn't working?
Thanks,
Max
10-12-2020 09:44 PM
Hi Max,
Is page_name "undefined" or undefined?
If it is a String then your code will work, however if page_name is simply undefined then you are probably looking for:
Or alternatively
Thanks,
Matt
10-14-2020 04:08 PM - edited 10-14-2020 04:09 PM
Hi Matt (@malexander),
Thanks for your response!
The page name shows the string "undefined" e.g "undefined:abc:products:shoes". This is shown in our analytics reporting platform.
Cheers,
Max
10-14-2020 08:41 PM
Hi Max (@max_wong),
In that case I see no issue with your approach, and have tested that it works based on your supplied code. My suggestion would be to raise a support ticket with support@tealium.com and share with them a live example (e.g. URL), so they can identify why the value for page_name is not being updated.
Thanks,
Matt
10-15-2020 08:52 AM
@max_wong Can you post a screenshot of the extension?
10-18-2020 04:57 PM
@david_bird - Sure. Please find the below for your viewing:
Thanks,
Max
10-20-2020 12:59 AM
Hi @max_wong ,
Were you able to debug the condition you have given for the set data values ?
Try putting debugger in that particular set datavalues in the utag.js file in your website and check whether your condition is getting passed ?
Thanks,
VJ
Copyright All Rights Reserved © 2008-2023