[#164] Trigger booking-confirm on widget to parent

Migrated from Redmine #164 | Author: Tiger Chi
Status: New | Priority: High, I’m very impatient | Created: 2018-05-14


Due to some reason, I need to setup 2 Google Adwords convention and 2 Facebook pixel when booking complete.
I use simplybook’s widget on my website, due to multi GA and pixels, I can not use " #booking-result-view .booking-item.booking-confirmed " to do so, or GA plugin.
had try use redirect to homepage plugin to run my js code, but it’s too slow for wait redirect, user often close page in 2 seconds. and not redirect yet.

So I try to get content from widget (iframe) to know if booking is complete, and find that I can get Window MessgeEvent from simplybook’s widget.js (https://simplybook.asia/v2/widget/widget.js)
In widget process, each step triggers “stepChange” event, but only “booking-confirm” status not. So I can not use this MessageEvent to trigger my javascript on parent web site.

Here is my suggestion:

  1. Is it possible to add one more “stepChange” MessageEvent to let me trigger my javascript when booking is complete?
  2. Is it possible to add a new plug-in to write javascript, and execute in iframe when booking complete?

By the way, I try to setup GA plugin, but Google Adwords convention still not work for me.
Thanks for read my issue.