AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

1.7K members online now
1.7K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
Guide Me

Code implementation with third party reservation system

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi  Would appreciate any advice please on implementing analytics.  Added the below tracking code to the web site which was provided by the reservation booking button provider.  Visitors and pages are being tracked but only around 10% of revenue is actually being recorded in ecommerce and the product category is only showing 'room' rather than the room type or description. (i've removed the cid property name just for this post from the snippet below).  


<?php wp_head(); ?>
<script src="/js/respond.js">
<script src="/js/html5shiv.js"></script>
<!-- Universal Analytics Google -->
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

var tbb_ga = 'UA-2585112-1';
var tbb_cid = 'hotel';
var tbb_domain = '';

ga('create', tbb_ga, {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', [tbb_domain]);
ga('send', 'pageview');

ga(function(tracker) {
window.linker = window.linker || new window.gaplugins.Linker(tracker);
if(document.referrer.indexOf(document.domain)!=7) {
var e = document.createElement('iframe');
e.setAttribute('style', 'display:none');
var b = document.getElementsByTagName('body')[0];

// Automatically apply TBB prefix to thebookingbutton links
this.href = this.href.replace(new RegExp(tbb_domain+'/properties', 'i'), tbb_domain+'/'+tbb_cid+'/properties');
<!-- End Universal Analytics -->