- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
01-16-2020 09:50 AM - edited 01-16-2020 10:32 AM
Hi,
Not sure any one have tried it, is there a way to to utag.link or view call with nested object??
Below example will give a better understanding I believe -
datalayer exist on the page:
utag_data = { 'a': 'Test A', 'b': 'Test B', 'c': 'Test C', 'd': 'Test D', 'e': 'Test E', 'CC': { 'v1': 'VA1', } }
Link or View Call:
utag.view({ 'f':'Test F', CC['v2']: 'Value 2' })
when I do a link call it replaces the entire 'CC' blob. Below is the screen shot -
Step1: creating 'CC' with only one key('v1')
Step2: Insert a new key('val2') to the existing 'CC' object and it rewrites the entire 'CC' object
I am unable to target the nested object. Any suggetions or ideas??
Thanks
01-17-2020 06:08 AM
Hi @mvenkatesan
So utag works with a flat JSON object as the data source.
I would suggest looking the Flatten JSON Objects Extenion or if you want more control over what it is doing here is a version that you can add to a JS snippet.
Adrian
Copyright All Rights Reserved © 2008-2023