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
BedrockMission!

Learn More

View all

Sign in to view all badges

iFrame and postMessage method Help

Avatar

Avatar
Level 1
Ikinet
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Ikinet
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Ikinet
Level 1

16-02-2021

Hi all,

i have this problem: in our site we have the a-page with an embedded iFrame.

The iFrame it's under control of the devs and has no Launch script inside.

I want to track some click events that occurs inside that iFrame.

In the Adobe Analytics documentation i found one method to track iFrames- it’s about inserting a code into the page (which I imagine can be done with Launch) and some code in the iFrame. However this method seems specific to trigger a pageview when a user clicks on the iFrame.

 

So, is it possible to track specific events that occurs on click, and save certain informations like we can do with direct calls? 

For example, when the user clicks on the a-element i'd like to have an event with a prop that stores "a-element".

How can i do that?

 

Thank you very much for your time!

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Establish
MVP
evolytics_brian
MVP

Likes

70 likes

Total Posts

145 posts

Correct Reply

44 solutions
Top badges earned
Establish
Seeker
Give Back
Engage 1
Boost 50
View profile

Avatar
Establish
MVP
evolytics_brian
MVP

Likes

70 likes

Total Posts

145 posts

Correct Reply

44 solutions
Top badges earned
Establish
Seeker
Give Back
Engage 1
Boost 50
View profile
evolytics_brian
MVP

16-02-2021

@Ikinet -

postMessage is likely going to be your best option, but your dev team will have to trigger the call from inside the frame. For example, you can have them add an onclick to the links you are interested in that triggers the postMessage event (with the desired event payload). Then, from Launch, you can add an event listener that reacts any time a message comes through, triggering the desired analytics calls.

 

MDN Web Docs details how postMessage works: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage