var analytics = { bConsole: false, bDebug: true, siteId: null, tracker: null, init: function (a) { try { if (typeof console !== "undefined" && this.bDebug) { this.bConsole = true; console.log("analytics.js init()") } this.siteId = a; this.tracker = _gat._getTracker(this.siteId); this.tracker._setDomainName("none"); this.tracker._setAllowLinker(true); this.tracker._initData(); this.tracker._setSessionTimeout("2400"); this.tracker._trackPageview(); this.trackEcommerce() } catch (b) { } }, addTrans: function (a, b, c, d, e, f, g, h) { if (this.bConsole) { console.log("analytics.js addTrans() orderId: " + a + " lodge: " + b + " total: " + c + " tax: " + d + " shipping: " + e + " city: " + f + " state: " + g + " country: " + h) } this.tracker._addTrans(a, b, c, d, e, f, g, h) }, addItem: function (a, b, c, d, e, f) { if (this.bConsole) { console.log("analytics.js addItem() orderId: " + a + " skuCode: " + b + " desc: " + c + " category: " + d + " price: " + e + " quantity: " + f) } this.tracker._addItem(a, b, c, d, e, f) }, trackTrans: function () { if (this.bConsole) { console.log("analytics.js trackTrans()") } this.tracker._trackTrans() }, trackEcommerce: function () { if (this.bConsole) { console.log("analytics.js trackEcommerce()") } if (typeof confirmation !== "undefined") { if (this.bConsole) { console.log("analytics.js trackEcommerce() found confirmation json") } analytics.addTrans(confirmation.order.orderId, confirmation.order.lodge, confirmation.order.total, confirmation.order.tax, confirmation.order.shipping, confirmation.order.city, confirmation.order.state, confirmation.order.country); for (var a = 0, b = confirmation.products.length; a < b; a++) { analytics.addItem(confirmation.products[a].orderId, confirmation.products[a].skuCode, confirmation.products[a].desc, confirmation.products[a].category, confirmation.products[a].price, confirmation.products[a].quantity) } analytics.trackTrans() } } }

