When a dashboard is embedded in an iFrame, users are able to capture a small number of custom events to help them understand the usage of that dashboard. The surrounding (parent) page needs to have implemented JavaScript code in order to listen for events being fired from the dashboard (child) page.
Section Links
Example JavaScript
Example JavaScript in the Parent page that has the iFrame:
<script> let messageList = []; window.addEventListener("message", (event) => {
alert(event.data);
if (event.origin !== "https://<your full domain name>")
// This domain isn't what we're looking for, simply return from the function
return; }, false);
</script>
Events Captured
Events Captured:
-
User Active - the user is active and logged in
-
Dashboard Loaded - the dashboard frame has been loaded successfully
-
Advertiser Loaded - the advertiser for the dashboard has been loaded successfully
-
Tab Loaded - a page change in the dashboard was initiated
-
Date Changed - the date range has been changed for the dashboard
-
Dashboard Export Requested - the active user has clicked the link to generate and
download the report version of the dashboard
-
Dashboard Export Complete - the download was completed
-
Logout - the user has logged out of the dashboard
Comments
0 comments
Article is closed for comments.