when I try below to access datalayer in custom template using copyFromWindow,
`if (queryPermission('access_globals', 'readwrite', 'dataLayer')) {
const dataLayer = copyFromWindow('dataLayer');
log('dataLayer =', dataLayer.length);
}`
output :` `[{"gtm.start":1631682185554,"event":"gtm.js","gtm.uniqueEventId":3}]
I am trying to access say 13th item in the dataLayer array I can get the value by doing dataLayer[13].segments in console. But unable to figure out how to do this in the custom template