Setting up Google Tag Manager


I’m looking to set up a tracking code through GTM so I can track bookings to the website. The code pulls in some information from the wix website and passes on to the dashboard through a GTM tag. There are two issues I’d like help with.

  1. The code needs a unique ID to be passed after a booking is done so it can record it as a ‘transaction’. What’s the best way to generate or pull a unique ID from the Wix bookings app after the booking is done? I looked up the Velo reference page for Wix bookings API and it looks like bookingID is the variable that pulls in the ID. Would it suffice to just pass bookingID in the variables sections in GTM like below:

The code that uses this variable is below in the tag section of GTM

 <script language="JavaScript">
 tdconv('init', 'xxxxxx', {'element': 'iframe' });
 tdconv('track', 'sale', {'transactionId':'{{TradeDoublerOrderID}}', 'ordervalue':'{{TradeDoublerOrderValue}}', 'currency':'GBP', 'event':xxxxxx});
	2. I have to give a trigger when the above code fires when a booking is done and the trigger currently is whenever user lands on a page with URL that contains 'book'. This is not really ideal because the wix bookings app has one URL from showing the slots to the booking form to the confirmation of the booking. So, the way I set it up, the trigger fires even when the user lands on the 'select a date and time slot' page which is not really accurate for measuring bookings as they can drop off before actually booking. Is there a way to ascertain the trigger fires only after the booking is made? Keep in mind that we have to work with the options available in the GTM for when the trigger should fire. 

Thanks for the help.

@yisrael-wix may be you have some pointers? Thanks.

Wix is unable to provide support for external custom scripts. Maybe some of the forum members can provide ideas. Perhaps you can find someone on the Wix Marketplace to help you.

Let me rephrase the question the above questions that may be relevant to Velo Code (I provided additional information above for context).

  1. How do I pull the unique Booking ID using Velo code after a booking is done? I’m using the Wix Bookings app.

  2. Is there a way to provide a thank you page after the booking is done using Velo with a unique URL other than
    for example, which stays the same throughout the booking intiation to booking confirmation. This way I can track that a booking is done. I checked out the documentation on changing the thank you page but it’s very limited and so checking to see if Velo can help
    Wix Bookings: Customizing Your Thank You Page | Help Center |

Just following up to see if anyone has any thoughts. I have a feeling it should be quick pull from the API but I may be wrong.