Google Analytics for mybookings

Follow

You can track your booking engine visits, conversion rate and collect other data by entering a Google Analytics Tracking ID into myfrontdesk.

This article will walk you through the basics of adding a Google Analytics Tracking Code to your mybookings' page. To learn about how to setup and use Google Analytics, please consult the following resources:

Proper Google Analytics tracking won't work when using the booking engine inside an iframe due to the latest versions of Chrome that does not allow cookies sharing within the context of an iframe and multiple domains. Additional coding and configuration will be needed with the help of a developer. For more details on implementation, check this link. However, if you configure a 'Book Now' button that redirects clients to your Booking Engine, Google Analytics will properly perform its tracking functions.

Step 1 - Enter your Tracking ID

In your Cloudbeds' account, click on Manage

  1. Under Booking Engine section, click on Analytics
  2. Enter your Tracking ID
  3. Enter your website domain
    • Your website domain is the highlighted part of this example: https://www.your-website.com as shown below
  4. Click Save

By adding your tracking code on Cloudbeds, your Google Analytics account will start tracking any visits your booking engine receives and also reservation details when a visitor finalizes a booking.

The information sent to Google Analytics are: Reservation Number, Property Name, Reservation Total, Reservation Taxes and Room Types.

1. Install Google Tag Manager on your website

If you have been using Google Analytics for a while you might be still using the Classic version. Below you can learn how to update your tracking code

As the first point of contact to your guests, it is recommended to add Google Analytics tracking to your own website. We suggest using Google Tag Manager. Also, cross-domain tracking should be enabled since Cloudbeds' mybookings (our booking engine) is hosted in a different domain as yours.

To do so, follow the instructions below:

1.1. Create a Google Tag Manager Account
  1. Click Tags from the navigation menu
  2. Click New to create a new Analytics Tag
  3. Under Tag Configuration click the icon to begin setup
  4. Choose Google Analytics: Universal Analytics from the list

If you already have a Google Tag Manager container, please review the instructions below and update your settings accordingly

  1. Check the box Enable overriding settings in this tag
  2. Enter your Google Analytics Tracking ID
  1. Under More Settings > Fields to Set > add the following field:
    • allowLinker: true
  2. Optional: If you are planning to embed the booking engine on your website using an iFrame, include these additional fields:
    • cookieName: {{cookieName}}
    • hitCallback: {{iframeTracking}}
  1. Under E-commerce, select True for Enable Enhanced E-commerce Features and check the Use Data Layer box
  2. Under Cross-Domain Tracking > Auto Link Domains enter cloudbeds.com and select True for Decorate Forms
  3. Triggering - Google Analytics tag should trigger on all pages
Optional: Booking Engine embedded on iFrame

If you are planning to embed your booking engine to your website using an iFrame, please make sure to take these additional steps:

  1. Click Variables from the navigation menu
  2. Under User-Defined Variables, click New
  3. Click the icon to choose a variable type
  4. Choose Constant under Utilities
  1. Write cookieName as the variable name
  2. Click on Constant to display the value field and enter _cloudbeds
  3. Click the Save button on the top-right corner
  1. Repeat the process to add a new Constant Variable
  2. Now, rename this variable to iframe
  3. Click on Constant to display the value field and enter iframe.iframe-class
  4. Click the Save button on the top-right corner

The iFrame code on your website must include class="iframe-class" as shown below:

<iframe src="YOUR_MYBOOKINGS_URL?widget=1" width="100%" scrolling="no" class="iframe-class" frameborder="0" id="cloudbeds">

  1. Repeat the process one more time to add a Custom JavaScript variable
  1. Now, rename this variable to iframeTracking
  2. Click on Custom JavaScript to display the text field for the code
  1. Copy and Paste the following code on the Custom JavaScript field
function() {
  return function() {
    try { 
      var gobj = window[window.GoogleAnalyticsObject];
      // Select the iframe you want to decorate
      var iframe = document.querySelector({{iframe}});
      var tracker, linker;
      if (gobj && iframe) {
        // Get tracker with current cookieName
        tracker = gobj.getAll().filter(function(obj) { return obj.b.data.values[':cookieName'] == {{cookieName}}; })[0];
        if (tracker) {
          linker = new window.gaplugins.Linker(tracker);
          iframe.src = linker.decorate(iframe.src);
        }
      }
    } catch(e) {
     console.log('GTM Error', e);
    }
  }
}	

Click on Save button on the top-right corner

When you complete these steps you will have the following User-Defined Variables

  1. Now, click on Submit on the top-right corner and follow the on-screen instructions to publish your changes.
1.2. Install Google Tag Manager on your website
Wordpress Instructions

If your website is built on Wordpress, we recommend you use this plugin to add your tracking code. To install the plugin, follow these instructions:

  1. On your Wordpress dashboard, click on Plugins on the menu
  2. Click Add New
  3. Search for Google Tag Manager For Wordpress
  4. Click on Install and then Activate

After installing, click on the link that is displayed on the top of the page to enter your GTM ID.

Enter your GTM ID on this page and Save. You can find your GTM ID on your Workspace on Google Tag Manager website.

Installing Google Tag Manager Manually

If your website is not designed for Wordpress or services like Wix and Squarespace, you may need to enter the code manually. You can follow the instructions provided by Google in this article

2. Configure your Google Analytics Account

2.1. Configure the View Settings

First, ensure your currency is set up properly on Google Analytics. If it is not set up correctly, Google will convert the currencies and display them incorrectly.

Sign in to Google Analytics

  1. Click Admin, and navigate to the view you want
  2. In the VIEW column, click View Settings
  3. Under Exclude URL Query Paraments enter "ga_sess_id,currency,promo,widget,data_res"
  4. Under Currency displayed as select the same currency as you have configured on your Cloudbeds account.
    • If you can't find the same currency, choose a different currency with a conversion rate equivalent to the preferred currency. Google will display the amount converted.

Scroll down and click Save

2.2. Enable E-Commerce Reporting

If you haven't enabled E-Commerce Reporting on Google Analytics, you won't be able to see detailed reports from your reservations.

You need to enable Ecommerce for each view in which you want to see the data:

Sign in to Google Analytics

  1. Click Admin, and navigate to the view you want
  2. In the VIEW column, click Ecommerce Settings
  3. Set Enable Ecommerce to ON
  4. Optional: Set Enable Related Products to ON
  5. Click Next step and then click on Submit

In a few days, you will begin to receive these reports and can access them by going to Conversions > Ecommerce > Overview

The screenshot of the Acquisition Report below shows from which channels the traffic is coming to the website or booking engine. You can access these reports within your Google Analytics account:

  1. All Web Site Data section
  2. Acquisition
  3. All Trafic
  4. Channels
2.3. Exclude referrals from your website
  1. Sign in to your Analytics account
  2. Click Admin
  3. In the Account column, use the drop-down to select the Analytics account that contains the property you want to work with.
  4. In the Property column, use the drop-down to select a property.
  5. Click on Tracking Info and then Referral Exclusion List.
  6. To add a domain, click +ADD REFERRAL EXCLUSION.
  7. Enter the Domain name for your website (your-website.com).
  8. Click Create to save.
  9. Repeat the process and add cloudbeds.com
2.4. Set up Goals (Optional)

If you wish to create a Goal for every time a reservation is finalized, you can do so by adding the regular expression /reserv.*con.* in the Goal Details.

Use this expression to account for all possible languages our booking engine can use.

3. Test your configuration

To make sure everything is configured correctly, you can use the Google Tag Assistant extension for Chrome.

 To learn how to test your Google Analytics setup, please read this article from the Analytics Help Guide.

Things to Note

  • By adding your Google Analytics tracking code in your myfrontdesk configuration, you will only be tracking visitors and reservations from the moment the visitor arrives at the booking engine. To track visits to your own website you must add the tracking codes to it as well
  • If you don't see any Ecommerce or Goals results in your Analytics report, check if you have received any Website reservations during that period. If you have not received any reservations, you could also make a test reservation to verify that its tracking properly
  • Check all information about reservation amount, user interaction, source, from within Google Analytics reports. The tracking information is not available in Cloudbeds reports.
  • If you have configured Google Analytics in myfrontdesk but you can only see the bookings engine page as visited on your reports, you must configure Google Analytics in your website as well and it must include cross-domain instructions as explained on this article above.
Powered by Zendesk