Google Analytics Conversions - Ecommerce Overview
Posted by Jason Timms on 26 Sep 2012 07:37 AM

Google Analytics Conversions - Ecommerce Overview

BookingCenter offers the option to track Google Analytics's (GA) Goals and Conversions via the Booking Engine. In order to use these services, you need to have a Google Analytics Account setup. And you need to have a Webmaster or marketing person who understands how GA needs to be setup for Goals and Conversions. This is important, because BookingCenter's MSO feature is NOT a service to setup, interpret, nor manage your GA account - we simply offer technology that allows the GA architecture to be used with our Booking Engine.

More can be learned at: for setting up and working with Google Analytics's (GA) Goals and Conversions. Please know that if you are going to use the Booking Engine inside an iFrame, then read below for issues with Google Analytics and iFrames.

More can be learned at: for setting up BookingCenter to work with Google Analytics, but we HIGHLY recommend reading the PDF we wrote on how to do this here.

The broad outline for working the Goals and Conversions via the Booking Engine is as follows:

Step #1 – Setting up your Google Analytics in BookingCenter
Step #2 – Generate a Booking via your website.
Step #3 – Tracking your Bookings through Google Analytics Reporting

Step #1 – Setting up your Google Analytics in BookingCenter
Setting up the Google Analytics with the Desktop PMS view here:

*note, if you have questions about how GA3 differs from GA4 in support of our tracking, read the documentation here.

Setting up the Google Analytics with the MyPMS or Channel Manager view:  where we give detailed directions for placing the Google Analytics code.

Note, the Google Analytics Code needs to be retrieved from your Google Analytics account and placed into the MSO area.  We have a sample screen shot here for what this looks like.

Step #2 – Generate a Booking via your website.

On your website, generate an online booking after placing the codes as described above.

We have a Test GA account you can view how it's working for our test Account at: Click on Book Now! and make a booking to test this (nothing will be charged to you, this is just a test account).

If you are having trouble getting your GA to update based on the Goals and Conversions you set, our advice is to make your own test pages, post the GA code to your Test Account using hard-coded values in place of our dynamic values. Make sure the only difference in the code between your Test pages and the Booking Engine are the two variables our Request Server dynamically posts:


Make a booking and have it register on GA (remember, it takes 24 hrs to register usually). Then once you know it registers, do it with the Request Server (dynamically, where we post the booking_id and total_price ) and view the results in GA. You can test the two case studies by choosing your browser's 'show source' and code check the results - GA ought to be identical between your Test pages and results from the Request Server that post dynamically from the booking ID and cost of the booking.

Note: Tracking from your Google Analytics account can take up to 24 hrs. What this means is that a booking you make NOW may not show in your Google Analytics account for up to 24 hrs - sometimes a little faster.

Step #3 – Tracking your Bookings through Google Analytics Reporting
Learning how to setup the Goals and Conversions in GA is not trivial, though there are thousands of webmasters globally who know how to do it. A simple Google search can introduce you to one of these.

For a sample of information reported back from our Test account, as booked above, please see the attached document to this KnowledgeBase article.

Using iFrames and Google Analytics?
Google provides a javascript line that enables you to "allow" google to have its cookie file follow the person through an iframe to capture eCommerce data. It will NOT, however, provide that code easily, or when you copy and paste it from the analytics site. We believe its because its script, by default, doesn't wish to scrape up tons of iframe data unless explicity told to do so, freeing up its servers. This is only our assumption as to why Google makes this difficult for iFrame implementations.

So after communicating and delving pretty deep in the dev community, we found a snippet of javascript:

_gaq.push(function() {
var pageTracker = _gat._getTrackerByName();
var iframe = document.getElementById('IFRAMEID');
iframe.src = pageTracker._getLinkerUrl('IFRAMESOURCE');

When placing the code into the google generated analytics code like so:

where blockrandom was the Iframe ID and the iframe.src was re-directed appropriately to BookingCenter.

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'XXXXX']);
_gaq.push(['_setDomainName', '']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(function() {
var pageTracker = _gat._getTrackerByName();
var iframe = document.getElementById('blockrandom');
iframe.src = pageTracker._getLinkerUrl(';);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl&#039; : 'http://www&#039;) + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


Often times there is some code to edit that generates google analytics code for a specific CMS theme - weve witnessed this using joomla, wordpress, and Ruby. When removed, and only using google-generating, hard-coded code in the javascript of the theme header of the CMS, we had success.  Getting this clear is vital to make sure clients with Iframes use this approach and method. All-in-all, its just telling googles javascript where to look, and where to go.


BookingCenter requires that an MSO 'Premium Marketing Services' contract is in place in order for this to work. Go to: to request the service or call us at +1-707-874-3922 ext 201.

Learn more about the MSO 'Premium Marketing Services' contract at:


 1348679574466_google_analytics_conversion.pdf (301.84 KB)
(5 vote(s))
Not helpful