In this post, you'll learn how to add Lockme tracking code (connect.js) to your site to relay booking events to analytics and advertising tools such as Meta Pixel, GA4 or TikTok Pixel.

    What are tracking codes?

    Tracking codes (e.g. Meta Pixel, Google Analytics 4, TikTok Pixel) are pieces of scripts on your site that record user actions. This allows you to:

    • measure the effectiveness of advertising campaigns,
    • create remarketing (e.g. someone opened a booking slot, but didn't finish),
    • launch renewal campaigns (e.g. after a few weeks or months),
    • analyze at which stage users drop out.

    How it works?

    1. The user performs an action in the widget (e.g. opens a slot, clicks "Book", proceeds to payment).
    2. The widget sends information about the event to the tracking codes available on the site (e.g. Meta Pixel, GA4, TikTok Pixel).
    3. You can then see the events in your analytics or advertising tool.

    Requirements

    The integration will work if you meet the following conditions:

    • the Lockme widget must be implemented on the site in the latest version,
    • the Lockme script (connect.js), which allows events to be passed from the widget, must be embedded in the <head> section of the page,
    • tracking codes (e.g. Meta Pixel, GA4, TikTok Pixel) must be installed on the same page.

    Important: you add the connect.js script to the page only once, even if you have several widgets.

    Recorded events

    ViewContent

    Sent when a booking for a specific slot is opened. The ID of the slot is passed as the ID, and the room name is passed as the name along with the slot.

    AddToCart

    Sent when the "Book" button is clicked on a properly filled reservation form. Information about price, currency, ID and room name is transmitted.

    InitiateCheckout

    Sent when the payment process is initiated. For bookings without payment, the event is not sent. Information about the price, currency and contents of the shopping cart is transmitted.

    Purchase

    This event is not sent from the widget. The conversion occurs on the thank you page, which is outside the widget. If the script is also embedded on the thank you page, the Purchase event will send automatically based on the parameters from the URL (query).

    Thank you page

    epending on how the user completes the booking in the widget, they may hit different confirmation screens:

    Online payment

    Once the user has paid for the reservation, he or she goes to a confirmation page. By default, this is the Lockme page, but we can enable a redirect to the thank you page on your site (contact us at [email protected] about this). This is also important if you care about counting the "Purchase" event in analytics, because when redirecting to the Lockme page, this event does not count.

    On-site card/cash payment

    The user completes the process without online payment. There are two paths further:

    • if redirection after clicking on the link from the confirmation email is enabled, the customer goes to the thank you page on your site after clicking,
    • if not, the customer sees a confirmation screen within the Lockme widget after completing the booking.

    Parameters sent to thank you page:

    • roomid
    • date
    • h (time of booking)
    • id (reservation ID)
    • price
    • currency

    For paid reservations, additional information is provided:

    • order (order ID)
    • status (link to page with order status)

    How to implement the script in WordPress?

    1. Embed the Lockme widget on your site

    You can find detailed instructions for embedding the widget in the article "Booking widget basics".

    2. Copy the script from the Lockme panel

    In the Lockme panel, go to the Companies tab, then go to Widgets and copy the script (1). Remember: you add it to the page only once, even if you have several widgets on the page.

    3. Download the plugin to paste the script in HEAD

    When choosing a plugin, check:

    • the number of active installations (the more, the higher the chance that the plugin is verified),
    • user ratings and reviews,
    • the date of the last update (ideally, the plugin should be updated regularly),
    • compatibility with your version of WordPress.

    Example plugins:

    4. Paste the script into the HEAD in WordPress

    Add the script copied from the Lockme panel to the HEAD section of your site. Below you will find instructions on how to do it:

    1. Install and activate the plugin of your choice in WordPress.
    2. Go to the plugin's settings (often found in the Tools menu or in a separate tab in the panel).
    3. Find the Head Code type field.
    4. Paste the script copied from the Lockme panel.
    5. Save the changes.

    Need help?

    Write to [email protected].

    Hallo, unsere Website verwendet Cookies, damit alle Funktionen ordnungsgemäß funktionieren können.

    Zusätzlich zu diesen notwendigen Cookies verwenden wir auch Cookies von Dritten, damit wir Analyse-, Social-Media- oder Marketing-Tools von Dritten nutzen können. Das bedeutet, dass die damit erhobenen Daten auch von den Anbietern dieser Tools verarbeitet werden.

    Bist du mit der Verwendung von Cookies einverstanden, die nicht für den Betrieb der Website erforderlich sind, wie in unserer Datenschutzerklärung beschrieben wurde?

    Cookie-Einstellungen

    Hier kannst du die detaillierten Einstellungen für die auf unserer Website verwendeten Cookies ändern. Wenn du einer bestimmten Art von Cookies zustimmst, bedeutet dies, dass du damit einverstanden bist, dass die von ihnen gesammelten Daten vom Administrator dieser Website sowie vom Anbieter des von uns verwendeten spezifischen Tools verwendet werden - wie in unserer Datenschutzrichtlinie beschrieben wurde.

    Diese Art von Dateien ist für das ordnungsgemäße Funktionieren unserer Website erforderlich. Sie werden unter anderem dafür verwendet, dass der Browser das vom Nutzer gewählte Land, die Produkte im Einkaufswagen oder das Farbthema der Website speichert.

    Anhand dieser Dateien können wir nachvollziehen, wie die Nutzer auf unserer Website navigieren. Ein solches Tool ist Google Analytics, mit dem wir anonyme Informationen über die Anzahl der Besuche, die Nutzung bestimmter Funktionen oder die Art der Benutzergeräte sammeln können. Dank dieser Daten können wir die Website an die Bedürfnisse und Fähigkeiten der verschiedenen Nutzer anpassen.

    Tools von Google, TikTok, Facebook und Seznam.cz, die Informationen über Nutzer sammeln, die wir für Marketingzwecke nutzen können.