I'm trying to create a rule where when a user clicks an icon on the page the rule fires. The icon is however within an iframe, and i cannot target the URL.
Solved! Go to Solution.
Views
Replies
Total Likes
Any user interaction within an IFRAME usually cannot be detected by the parent frame, which is where your Launch property is. And so Launch will not be able to detect those interactions/events.
If you can add code to the page in the IFRAME, consider using postMessage() in the IFRAME to send the event data up to the parent frame. Then within Launch, you can use window.addEventListener('message', callbackFunction) to handle those events as you wish.
Any user interaction within an IFRAME usually cannot be detected by the parent frame, which is where your Launch property is. And so Launch will not be able to detect those interactions/events.
If you can add code to the page in the IFRAME, consider using postMessage() in the IFRAME to send the event data up to the parent frame. Then within Launch, you can use window.addEventListener('message', callbackFunction) to handle those events as you wish.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Yes, the postMessage() allows you to send any string from the IFRAME to the parent, so it's up to you to decide how you want to structure that string with the required values that you want. A JSON sting might be the easiest, simplest format to use.
In Launch, you can detect a postMessage() by using a "Custom Code" event. In that Custom Code, use this:
window.addEventListener('message', function(event) {
if (event.origin === 'www.iframe-domain.com') {
trigger();
}
});
You can then use your postMessage()'s data in your Rule's conditions and actions like so:
%event.data%
or
in Custom Code, event.data.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies