// Start - Google (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'); // update domains var livedomain = "www.joinluxaire.com"; var liveUA = "UA-1973977-2"; //live UA number var devUA = "UA-1973977-X"; //stage UA number ga('create', ((window.location.hostname == livedomain) ? liveUA : devUA), 'auto'); ga('send', 'pageview'); var dependencyTimer; if (typeof jQuery === 'undefined') { dependencyTimer = setInterval(waitForjQuery, 100); } else { AnalyticsTag(); } function waitForjQuery() { if (typeof jQuery != 'undefined') { AnalyticsTag(); clearInterval(dependencyTimer); } } var delayTarget = null; function delayHandler(elem) { // short circuit - no need to delay calls that are opening in a new window if ($(elem).attr("target") == "_blank") { return true; } if (delayTarget) { SimulateEvent_Click(delayTarget); delayTarget = null; return true; } else { delayTarget = elem; setTimeout(delayHandler, 200); return false; } } function SimulateEvent_Click(elem) { var me = document.createEvent('MouseEvents'); me.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); elem.dispatchEvent(me); } function AnalyticsTag() { // THIS REQUIRES JQUERY 1.7 OR NEWER jQuery(document).ready(function () { currHref = window.location.pathname.toLowerCase().replace("default.aspx", ""); filetypes = /\.(zip|exe|pdf|doc|docx|xls|xlsx|ppt|pptx|mp3|mov|avi|wmv|jpg|gif|png|dxf|dwg)(\?.*)?$/i; jQuery("html").on("click", 'a', function () { if (!(jQuery(this).attr('name'))) { var href = jQuery(this).attr('href'); if (href != undefined) { var externalDomain = href.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); if (href.match(/^mailto\:/i)) { //MAILTO TRACKING var mailLink = href.replace(/^mailto\:/i, ''); var anchorText = jQuery(this).text(); ga('send', 'event', 'Mailto', anchorText, currHref); } else { //Testing for downloads first. For downloads that are also external, this will be the fallback anchorText when applicable. if (href.match(filetypes)) { //FILE DOWNLOAD TRACKING //trailing if (href[href.length - 1] == "/") { href = href.substring(0, href.length - 1); } var extension = (/[.]/.exec(href)) ? /[A-Za-z]{3,4}(?=\?|$)/.exec(href)[0] : undefined; //post aspx if (extension == "aspx") { extension = /\.([^\.]*)\.aspx/.exec(href)[1]; } var fileTitle = jQuery(this).attr('title'); ga('send', 'event', extension.toLowerCase() + '-Download', fileTitle, currHref); } if (externalDomain && externalDomain[1] && (!externalDomain[1].match(document.domain))) { //OUTGOING LINK TRACKING var extLink = href.replace(/^https?\:\/\//i, ''); var anchorText = jQuery(this).text().trim(); if (anchorText == '') { anchorText = (jQuery(this).attr('title') && jQuery(this).attr('title').trim()) || (jQuery(this).attr('alt') && jQuery(this).attr('alt').trim()) || (fileTitle ? (fileTitle + "." + extension) : ""); } if (anchorText == '') { anchorText = extLink; } ga('send', 'event', 'Outgoing Link', anchorText, currHref); } } } } }); // sub page jump nav analytics jQuery(".sub-jump-nav").on('click', function (e) { e.preventDefault(); var $this = $(this); var href = $this.attr('href'); var label = $this.text().trim(); ga('send', 'event', 'Trade-Site', "Jump-Nav", label); setTimeout(function () { window.location.href = href; }, 200); }); // jump nav analytics jQuery(".jump-nav").on('click', function (e) { var $this = $(this); var label = $this.text().trim(); if (jQuery(this).attr('href') == "#contractor") { //pixel code ftGoalTag86702(); } ga('send', 'event', 'Trade-Site', "Jump-Nav", label); }); // contact page - Continue jQuery("#btnContinue").on('click', function (e) { e.preventDefault(); var $this = $(this); var href = $this.attr('href'); var label; var selection = []; if ($("#chkAirConditioners").is(":checked")) selection.push('AC'); if ($("#chkFurnaces").is(":checked")) selection.push('Furnaces'); if ($("#chkOther").is(":checked")) selection.push('Other'); if (selection.length) { label = selection.join("|"); } else { label = "No-Selection"; } ga('send', 'event', 'Contact-Us', "Contact-Us-Distributor-Search", "View-Distributors-" + label); setTimeout(function () { window.location.href = href; }, 200); }); jQuery(".eyebrow-list li a").on('click', function (e) { if(delayTarget) return true; if (jQuery(this).attr('href') == "/locator.aspx") { //pixel code ftGoalTag86701(); } return delayHandler(this); }); jQuery(".section-intro--body p a").on('click', function (e) { if (jQuery(this).attr('href') == "https://www.upgnet.com") { //pixel code ftGoalTag86703(); } }); }); } function ftGoalTag86702() { var ftRand = Math.random() + ""; var num = ftRand * 1000000000000000000; var ftGoalTagPix86702 = new Image(); ftGoalTagPix86702.src = "http://servedby.flashtalking.com/spot/8/10085;86702;7801/?spotName=UPG_FY18_Luxaire_Become_a_Contractor&cachebuster="+num; } function ftGoalTag86701() { var ftRand = Math.random() + ""; var num = ftRand * 1000000000000000000; var ftGoalTagPix86701 = new Image(); ftGoalTagPix86701.src = "http://servedby.flashtalking.com/spot/8/10085;86701;7801/?spotName=UPG_FY18_Luxaire_Find_a_Distributor&cachebuster="+num; } function ftGoalTag86703() { var ftRand = Math.random() + ""; var num = ftRand * 1000000000000000000; var ftGoalTagPix86703 = new Image(); ftGoalTagPix86703.src = "http://servedby.flashtalking.com/spot/8/10085;86703;7801/?spotName=UPG_FY18_Luxaire_Order_Brochures&cachebuster="+num; }