Expand my Community achievements bar.

SOLVED

Access the datalayer from the Parent page level to Iframe level

Avatar

Level 2

Hi,

Actually I have a data layer set in the parent page, from which I have created the data elements in the DTM webproperty. Also I am using those data elements in the Direct call Tag which is currently getting invoked from the Iframe page. The Iframe page was not able to access the data layer values as it was defined in the parent page.

Can anyone suggest a way to access the dataelements/ datalayer from the Parent page level to Iframe level?

Thanks in Advance!

Sundhara M.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

If you can access them via the browser console, you can access them in DTM. Try accessing the data layer from the console using some suggestions off of StackOverflow:

How to access parent Iframe from JavaScript - Stack Overflow

Once you're able to access the data layer from within the iframe via console, you can use that code to assign data elements.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

If you can access them via the browser console, you can access them in DTM. Try accessing the data layer from the console using some suggestions off of StackOverflow:

How to access parent Iframe from JavaScript - Stack Overflow

Once you're able to access the data layer from within the iframe via console, you can use that code to assign data elements.

Avatar

Level 2

Hi, Can I have straight answer on how to get access of data elements in to iFrame created by DTM (Non Sequential HTML) script? Above answer won't make much sense to me.

Regards