Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Access the datalayer from the Parent page level to Iframe level

sundhara_m
Level 2
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
Gigazelle
Correct answer by
Employee
Employee

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
Gigazelle
Correct answer by
Employee
Employee

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

ltaparia
Level 2
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