[#321] Is the an ability to pass custom data to the iFramed booking form OR trigger a Javascript event from the booking form?

Migrated from Redmine #321 | Author: Rowan Reid
Status: New | Priority: Normal | Created: 2019-01-28


Hi there,

I am looking at embedding the iFrame booking form into my website (Payment Integrations | SimplyBook.me online booking system)

When the booking form is submitted I would like to track this submission on my website. I think there are two ways for me to go about this:

  1. Embed some custom Javascript in the iFramed page which can listen to a booking submission and perform an appropriate action (post the data to an external endpoint via Ajax)

  2. Pass a tracking variable into the iFrame via the src tag and have a hidden field in the from capture the data to be stored on the booking record in your system. To be then retrieved via the API at a later stage.

Could you please advise if either of these options sound possible? Even if we are not able to directly place custom Javascript on the iFramed page, if we are permitted to include a Google Tag Manager snippet then we should be able achieve what we want.

Thanks!

Redmine Admin wrote:

hi, you can enable API custom feature. In it settings there is callback url field which you can use to trigger your script each time when you have new booking.

Rowan Reid wrote:

Hi there, thanks for your reply! That is indeed helpful, though I have left out a key piece of information.

There is a cookie value that is stored in the browser on my website that will be hosting the iFrame. I need to be able to access that cookie at the time of booking and either pass it into the booking record somehow (maybe in a hidden field in the booking form?), or be able to trigger a Javascript event within the iFrame which could access the cookie value and then pass it to my system via Ajax).

Your solution sounds like it would work, provided I can some how get the cookie value stored in a field on the booking record.

Do you have any more advice?

Thanks so much.

Redmine Admin wrote:

Hi, you can use google tag manager plugin which allows to insert javascript via Google tag manager

Rowan Reid wrote:

Perfect, that will work - thanks very much!