Question

Parent window notification not triggering

  • 24 April 2024
  • 2 replies
  • 50 views

Following the example for implementing parent notifications, I have the following code to write to console.log all Calendly events: 

<html>
<body>
<h1>Calendly Embed Test</h1>
<div id="calendly-embed" style="min-width:320px;height:700px;"></div>

<script type="text/javascript" src="https://assets.calendly.com/assets/external/widget.js"></script>

<script>
Calendly.initInlineWidget({
url: '[INSERT YOUR CALENDLY URL EVENT HERE]',
parentElement: document.getElementById('calendly-embed'),
prefill: {},
});
</script>

<script>
function isCalendlyEvent(e) {
return e.origin === "https://calendly.com" && e.data.event && e.data.event.indexOf("calendly.") === 0;
};

window.addEventListener("message", function(e) {
if(isCalendlyEvent(e)) {
/* Example to get the name of the event */
console.log(">> Event name:", e.data.event);

/* Example to get the payload of the event */
console.log(">> Event details:", e.data.payload);
}
});
</script>
</body>
</html>

Running the above code renders the embedded Calendly perfectly, however, it does not write anything to the console window when events occur.  Can you shed some light as to why nothing is happening?

Thanks!


2 replies

UPDATE:  I reached out to Calendly support about this issue and they confirmed that it is a known issue on their end.  Once it is resolved then it should work.

UPDATE2:  Calendly support just informed me on 5/7/2024 that this issue has been resolved on their end.

Reply