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.

Note: 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:

1. Enter your Tracking ID in myfrontdesk

  1. In your Cloudbeds' account, go to Manage > Booking Engine > 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 on the bottom-right corner

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.

2. 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. Please continue reading this article to learn how to update your tracking code.

As the first point of contact to your guests, you should add Google Analytics tracking to your own website. We recommend you use Google Tag Manager for that. 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:

2.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 Ecommerce 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
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);
    }
  }
}	
  1. Click the 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.
2.2. Install Google Tag Manager on your website
Installing on Wordpress

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 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

3. Configure your Google Analytics Account

3.1. Configure the View Settings

Make sure your currency is set up properly on Google Analytics, otherwise Google will convert the amounts and display them incorrectly.

  1. Sign in to Google Analytics.
  2. Click Admin, and navigate to the view you want.
  3. In the VIEW column, click View Settings.
  4. Under Exclude URL Query Paraments enter "ga_sess_id,currency,promo,widget,data_res"
  5. 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 that you can relate to. Google will display the amount converted.
  6. Scroll down and click Save.
3.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.

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

In a few days, you should start seeing these reports under Conversions > Ecommerce > Overview

3.3. Exclude referrals from your website
  1. Sign in to your Analytics account.
  2. Click Admin.
  3. In the ACCOUNT column, use the dropdown to select the Analytics account that contains the property you want to work with.
  4. In the PROPERTY column, use the dropdown 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
3.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.

4. 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. You could also make a test reservation to verify if it is tracking properly.
Troubleshooting
  1. I configured Google Analytics in myfrontdesk, but I only see the booking engine page as visited on my reports
    • You must configure Google Analytics in your website as well and it must include cross-domain instructions as explained in the first chapter of this article.
Have more questions? Contact Support

Comments

Powered by Zendesk