dataLayer = []; (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'); // Google tag management ga('require', 'linkid', 'linkid.js'); ga('require', 'ec'); // Load the enhanced ecommerce plug-in. ga('require', 'displayfeatures'); ga('send', 'pageview'); // cross domain tracking ga('require', 'linker'); ga('linker:autoLink', ['checkout.buydomains.com', 'buydomains.com']); // IP Address tracking for BOT identification ga('set', 'IP', '54.240.145.52'); /** * custom event and page tracking helper functions */ var customGATracking = { // track a specific event then redirect to new location if needed eventTrack: function(cat, act, opt_label, opt_value, follow) { if (!follow) var follow = false; dataLayer.push({ 'event': 'GAEvent', 'uaCat': cat, 'uaAct': act, 'uaOptLabel': opt_label, 'uaOptValue': opt_value }); if (follow !== false) { window.location = follow; return false; } }, // track a custom page view pageTrack: function(uri) { dataLayer.push({ 'event':'VirtualPageview', 'vpURI': uri, 'vpTitle': 'Virtual Page View' }); }, // track specific links being clicked linkEvent: function(cat, act, val, uri) { customGATracking.eventTrack(cat, act, val); setTimeout(function() { window.location = uri; }, 500); return false; }, gaStartTime: false, gaTimer: { 'start': 0, 'end': 0 }, gaTrackTiming: function(event, category, el, label) { var endTime = new Date().getTime(); var timeSpent = endTime - customGATracking.gaStartTime; ga('send', 'timing', category, el, timeSpent, label); }, gaStartTiming: function() { customGATracking.gaStartTime = new Date().getTime(); }, startTimer: function() { customGATracking.gaTimer['start'] = new Date().getTime(); }, endTimer: function(cat, el) { customGATracking.gaTimer['end'] = new Date().getTime(); var tdiff = customGATracking.gaTimer['end'] - customGATracking.gaTimer['start']; ga('send', 'timing', timingCategory, timingVariable, timingValue, optLabel); } }