How to use Google Analytics into Wubook booking system

If you use Google Analytics to track the visits to your website, you can extend the functionalities to the WuBook online reception as well. The integration allows you to observe how your potential customers interact with online booking. This isn’t just a tracking system: it classifies each action, recording the requests, the lack of availability and displayed quotes. It also combines information on the periods required. If you use also Google Adwords you may be interested in tracking the number of conversions of your campaigns by the integration of Google Adwords and WuBook.

Guide to the integration

There are different procedures to implement the integration of Google Analytics. Below you’ll find all the possible scenarios. In any case, you must configure your Hotel control panel by specifying the code that Google has assigned to your Analytics account (something like UA-XXXXX-XX). After this step, you must change something on the website as showed in the next section.

Custom implementation of the online booking with iframe

In order to enable Google Analytics on Wubook’s control panel you must:

  • Fill the field “Google Key”
  • Flag “activate ga”
  • Select the type of the code you wish to use (the new analytics.js or the old ga.js)

If you’re using Wubook’s online reception via Iframe, you’re gonna need to insert the correct multidomain code and to invoke wubook’s code that generates the iframe on the callback of google analytics object.

The following is the old ga.js.

<!doctype html>
  <html lang="en">
    <head>
      <title>Iframe embedding</title>
      <script src="https://wubook.net/js/wblib.jgz"></script>
      <script type="text/javascript">
        var _gaq = _gaq || [];
         _gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
         _gaq.push(['_trackPageview']);
         _gaq.push(function () {
           var WuBook= new _WuBook(XXXXXXXX);
           var wbparams= {
             ...
           };
           WuBook.design_iframe("_wbord_", wbparams);

         });

         (function() {
           var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
           ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
           var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
         })();

      </script>
    </head>
    <body>
      <div id="_wbord_">
        <a href="http://en.wubook.net/" style="display: block; margin-top: 5px; text-decoration:none;border:none" target="_blank">
          <img src="https://wubook.net/imgs/default/booking_by_wu.gif" alt="Booking Engine" title="Hotel and tourism technologies" style="border:none;text-decoration:none"/>
        </a>
      </div>
    </body>
  </html>

While here is the new analitycs.js

<!doctype html>
 <html lang="en">
 <head>
   <meta charset="utf-8" />
   <title>Iframe embedding</title>
   <script src="https://wubook.net/js/wblib.jgz"></script>
   <script>
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     //})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
     })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

     ga('create', 'UA-5671244-2', 'auto');
     ga('send', 'pageview');
     // load plugin
     ga('require', 'linker');
     // Define which domains to autoLink.
     ga('linker:autoLink', ['wubook.net']);
     ga(function(tracker) {
        var WuBook= new _WuBook(XXXXXXXX);
       var wbparams= {
         ...
       };
       WuBook.design_iframe("_wbord_", wbparams);

     });
   </script>
 </head>
 <body>
   <div id="_wbord_">
     <a href="http://en.wubook.net/" style="display: block; margin-top: 5px; text-decoration:none;border:none" target="_blank">
       <img src="https://wubook.net/imgs/default/booking_by_wu.gif" alt="Booking Engine" title="Hotel and tourism technologies" style="border:none;text-decoration:none"/>
     </a>

Custom implementation of the online booking with pop-up

If you decide to make a custom implementation of online reception on your website, you must follow Google’s guidelines for the implementation of the “tracking for multiple domains”. If you want to open a new WuBook window by default, you need to do something like this.

pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
window.open(pageTracker._getLinkerUrl(bookingurl), ....)

Understanding the results

Once you integrated Google Analytics, how would we monitor requests on booking online? It easy! First of all, remember that Google Analytics can be delayed up to 24 hours, so do not be alarmed if -during the first few hours- you don’t see any new information.

After 24 hours, you can go to see Google Analytics data selecting the Contents menu on the left menu, then by clicking Event Tracking.

Google Analytics

As you can see, WuBook creates some categories:

  • WubookRequest: requests of availability with dates
  • WubookOpen: opening the online booking without dates
  • WubookPreview: view prices
  • WubookNoavail: display requests with the absence of availability
  • WubookReservation: viewing reservations

In addition to creating categories of events, WuBook gives you absolutely useful and valuable information: for each event, WuBook indicates the reference month (for example, WubookRequest 2011-05 means that a request was made for May 2011).

The integration to Google Analytics also provides an ecommerce tracking. This tool is useful when you implement the AdWords campaigns.

Enjoy!