내 커뮤니티 업적 표시줄을 확대합니다.

해결됨

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 채택된 해결책 개

Avatar

정확한 답변 작성자:
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.

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
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