(function($){ window.ESETAnalytics = { current_url: window.location.pathname.split('?')[0], mega_menu_products_activated: false, mega_menu_support_activated: false, sc_open: false, hamburger_expanded: false, init: function () { //console.log($.fn.jquery); this.setDebug(); this.addCJ(); this.addLeadsource(); this.addLeadsourceList(); this.addWebCampaign(); this.addNavigationEvents(); this.addDownloadEvents(); this.addCartEvents(); this.addFormEvents(); this.addCustbodyChatSalesRep(); this.addContentBrowserEvents(); this.addUnbounceFormEvents(); }, setDebug: function () { ESETTrack.debug = ESETUtil.readCookie('esetck_debug') ? true : false; }, tntConversion: function( mboxname ) { try { if( !$('#el_' + mboxname).length ) { $('body').append('
'); mboxDefine( 'el_' + mboxname, mboxname ); } mboxUpdate( mboxname ); } catch(e) {} }, addCustbodyChatSalesRep: function () { var id = ESETUtil.getGET('custbody_chat_sales_rep'); if (id) { if (Number(id) == id && id % 1 === 0) { ESETUtil.createCookie('custbody_chat_sales_rep', id, .25); } } }, addCJ: function () { var ref = ESETUtil.getGET('ref'); if (ref && ref.toUpperCase() == 'AFC-CJ') { var info = []; info.push(ESETUtil.getGET('attr') ? ESETUtil.getGET('attr') : ''); info.push(ESETUtil.getGET('pub') ? ESETUtil.getGET('pub') : ''); info.push(ESETUtil.getGET('shop') ? ESETUtil.getGET('shop') : ''); if (ESETUtil.getGET('attr')) { ESETUtil.createCookie('esetck_cj', info.join('|'), 60); } } }, addLeadsource: function () { var ref = ESETUtil.getGET('CMP'); if (ref && !ESETUtil.readCookie('esetck_ls')) { ESETUtil.createCookie('esetck_ls', ref, 60); } else { var ref = ESETUtil.getGET('ref'); if (ref && !ESETUtil.readCookie('esetck_ls') && ref.toUpperCase() == 'AFC-CJ') { ESETUtil.createCookie('esetck_ls', ref, 60); } } }, addLeadsourceList: function () { var ls = '', ref = ESETUtil.getGET('CMP'); if (ref) { ls = ref; } else { ref = ESETUtil.getGET('ref'); if (ref && ref.toUpperCase() == 'AFC-CJ') { ls = ref.toUpperCase(); } } if (ls != '') { if (!ESETUtil.readCookie('esetck_ls_list')) { ESETUtil.createCookie('esetck_ls_list', ls, 60); } else { var ls_list = ESETUtil.readCookie('esetck_ls_list'); ls_list = ls_list.split(','); ls_count = ls_list.length; if (ls_count < 7) { ls_list.push(ls); ESETUtil.createCookie('esetck_ls_list', ls_list.join(','), 60); } } } }, addWebCampaign: function () { var wc = ''; var ref = ESETUtil.getGET('CMP'); if (ref) { wc = ref; } else { ref = ESETUtil.getGET('ref'); if (ref && ref.toUpperCase() == 'AFC-CJ') { wc = ref.toUpperCase(); } } var utm = ESETUtil.getGET('utm_source'); if (utm) { if (wc != '') { wc += ' ' + utm; } else { wc = utm; } } if (wc != '') { if (!ESETUtil.readCookie('esetck_wc')) { ESETUtil.createCookie('esetck_wc', wc, 60); } else { var esetck_wc = ESETUtil.readCookie('esetck_wc'); esetck_wc = esetck_wc.split(','); wc_count = esetck_wc.length; if (wc_count == 7) { esetck_wc.shift(); wc_count--; } if (wc_count < 7) { esetck_wc.push(wc); ESETUtil.createCookie('esetck_wc', esetck_wc.join(','), 60); } } } }, addNavigationEvents: function () { if (!ESETUtil.readCookie('esetck_sc')) { ESETUtil.createCookie('esetck_sc', 'gws', 365); } $('#link-menu').click(function () { ESETTrack.event('hamburger-expanded', 'event1'); ESETAnalytics.hamburger_expanded = true; }); $(document).on('click', '.sidebar-close', function () { if (ESETAnalytics.hamburger_expanded) { ESETTrack.event('hamburger-collapsed', 'event2', { 'eVar63': 'hamburger-collapsed', 'eVar64': ESETAnalytics.current_url }); } }); $(document).on('click', '.search-result a', function (e) { // e.preventDefault(); var category = ($(this).closest('dd').prevAll('dt').first().text()) ? $(this).closest('dd').prevAll('dt').first().text().trim() : '', keyword = ($('#search-query').val()) ? $('#search-query').val().trim() : '', chosen_result = ($(this).attr('href')) ? $(this).attr('href') : '' ESETTrack.event('managed-search', 'event3', { 'eVar51': category, 'eVar52': keyword, 'eVar53': ESETAnalytics.current_url, 'eVar54': chosen_result }); }); $('#uniqueIdToIdentifyPageResults .item a').click(function (e) { var link_name = ($(this).attr('href')) ? $(this).attr('href') : ''; ESETTrack.event('managed-search-result-link-clicked', '', { 'eVar65': link_name }); }); $(document).on('click', '.search-result button', function (e) { // e.preventDefault(); var keyword = ($('#search-query').val()) ? $('#search-query').val().trim() : '' ESETTrack.event('managed-search', 'event3', { 'eVar51': 'View All Results', 'eVar52': keyword, 'eVar53': ESETAnalytics.current_url, 'eVar54': 'View All Results' }); }); $('.form-partner-login').submit(function () { ESETTrack.event('login-submitted', 'event5', { 'eVar80': 'Partner', 'eVar81': ESETAnalytics.current_url }); }); $(document).on('click', 'ul.nav-tabs li a', function () { if ($(this).closest('.tabs').length && $(this).closest('.tabs').attr('id')) { var div_id = $(this).closest('.tabs').attr('id'); var tab_name = ''; if ($(this).text().length) { tab_name = $(this).text().trim(); } var evar_tab = ESETAnalytics.current_url + '|' + div_id + '|' + tab_name; ESETTrack.event('tab', 'event6', { 'eVar68': evar_tab }); if (tab_name == 'Contact') { ESETTrack.page(ESETAnalytics.current_url + '|ContactUs'); // setting s.pageName for Contact tab } } }); $('#nav-main-deep a.link').mouseover(function () { var link_name = ($(this).text()) ? $(this).text().trim() : '', link_url = ($(this).attr('href')) ? $(this).attr('href').split('?')[0] : ''; if ((link_name == 'Products and Solutions' && ESETAnalytics.mega_menu_products_activated == false) || (link_name == 'Support' && ESETAnalytics.mega_menu_support_activated == false)) { if (link_name == 'Products and Solutions') { ESETAnalytics.mega_menu_products_activated = true; } if (link_name == 'Support') { ESETAnalytics.mega_menu_support_activated = true; } ESETTrack.event('mega-menu', 'event10', { 'eVar11': link_name, 'eVar12': link_url, 'eVar13': ESETAnalytics.current_url }); } }); $('.nav-secondary span.icon').click(function () { var link_name = ''; if ($(this).closest('a').attr('title').length) { link_name = $(this).closest('a').attr('title').trim(); } // turn off flag for hamburger ESETAnalytics.hamburger_expanded = false; // exclude hover on Cart icon if (link_name && link_name != 'Cart') { ESETTrack.event('main-nav-icon', 'event11', { 'eVar14': link_name }); } }); $('.skin-inverse .btn').click(function (e) { //e.preventDefault(); var banner_name = ($(this).closest('div').find('.section-title').text()) ? $(this).closest('div').find('.section-title').text().trim() : ''; if (banner_name != '') { ESETTrack.event('banner', 'event14', { 'eVar70': banner_name, 'eVar71': ESETAnalytics.current_url }); } }); $('.skin-inverse .source').click(function (e) { // testimonials //e.preventDefault(); var review_name = ($(this).closest('div').find('.title').text()) ? $(this).closest('div').find('.title').text().trim() : ''; var des_url = ($(this).attr('href').length) ? $(this).attr('href') : ''; var data67 = ESETAnalytics.current_url + '|' + review_name + '|' + des_url; ESETTrack.event('review', '', { 'eVar67': data67 }); }); $('#footer ul.nav-social-profiles a').click(function () { var icon_name = ''; if ($(this).text().length) { icon_name = $(this).text().trim(); } ESETTrack.event('footer-social-icons', 'event16', { 'eVar29': icon_name, 'eVar30': ESETAnalytics.current_url }); }); $('ul.nav-countries a').click(function () { var country = ''; if ($(this).text().length) { country = $(this).text().trim(); } ESETTrack.event('country', 'event17', { 'eVar33': country }); }); $('.nav-sitemap-footer a').click(function () { var link_name = ''; if ($(this).text().length) { link_name = $(this).text().trim(); } ESETTrack.event('footer-link', 'event32', { 'eVar58': link_name, 'eVar59': ESETAnalytics.current_url }); }); $('.nav-meta-footer a').click(function () { var link_name = ''; if ($(this).text().length) { link_name = $(this).text().trim(); } ESETTrack.event('footer-link', 'event32', { 'eVar58': link_name, 'eVar59': ESETAnalytics.current_url }); }); $('#sneaky-left a').click(function () { var link_name = ''; if ($(this).text().length) { link_name = $(this).text().trim(); } ESETTrack.event('sticky-nav-breadcrumb', 'event33', { 'eVar60': link_name }); }); $('#sneaky-right a.btn, #sneaky-right a.btn-buy').click(function () { var cta_name = ''; if ($(this).text().length) { cta_name = $(this).text().trim(); } ESETTrack.event('sticky-nav-cta', 'event34', { 'eVar61': cta_name, 'eVar62': ESETAnalytics.current_url }); }); $('#products-eset .rimg').click(function () { var link_name = ''; if ($(this).attr('alt').length) { link_name = $(this).attr('alt'); } ESETTrack.event('ecommerce-widget', 'event37', { 'eVar35': link_name, 'eVar66': ESETAnalytics.current_url }); }); $('#products-eset .name').click(function () { var link_name = ''; if ($(this).text().length) { link_name = $(this).text(); } ESETTrack.event('ecommerce-widget', 'event37', { 'eVar35': link_name, 'eVar66': ESETAnalytics.current_url }); }); $('#products-eset .btn-buy').click(function () { var link_name = ''; if ($(this).closest('div').find('.rimg').attr('alt').length) { link_name = $(this).closest('div').find('.rimg').attr('alt').trim(); } ESETTrack.event('ecommerce-widget', 'event37', { 'eVar35': link_name, 'eVar66': ESETAnalytics.current_url }); }); $(document).on('click', '.form-wdywtdt ul.selectpicker li', function () { if ($(this).text().length) { var option = '[' + $(this).text() + ']'; } ESETTrack.event('finder-changed', 'event41', { 'eVar72': option }); }); $(document).on('submit', '.form-wdywtdt', function () { var options = []; $('.form-wdywtdt .selectpicker').each(function () { if ($(this).attr('title')) { var option = $(this).attr('title'); } if (option) { options.push('[' + option + ']'); } }); if (options) { options = options.join(' '); } ESETTrack.event('finder-submitted', 'event42', { 'eVar72': options }); }); $(document).on('click', 'ul.nav-sub a', function () { if ($('ul.nav-sub a').closest('ul').find('a').first().text().length && $('ul.nav-sub a').closest('ul').find('a').first().text() == 'Home') { var link_name = ($(this).text().length) ? $(this).text().trim() : ''; ESETTrack.event('products-filter', 'event45', { 'eVar73': link_name }); } }); $(document).on('click', '.nav-sidebar a', function (e) { //e.preventDefault(); var link_name = ($(this).text().length) ? $(this).text().trim() : ''; ESETTrack.event('hamburger-link', '', { 'eVar63': link_name, 'eVar64': ESETAnalytics.current_url }); }); $('.nav-card-links a').click(function (e) { //e.preventDefault(); var link_name = ($(this).text().length) ? $(this).text().trim() : ''; ESETTrack.event('product-2nd-cta', '', { 'eVar69': link_name }); }); $(document).on('click', '.megamenu-hover', function () { $(this).find('a').each(function () { if ($(this).attr('href') == 'http://helpus.eset.com/') { ESETTrack.event('live-chat-support-click', 'event43', { 'eVar82': 'Live Chat Support|MegaMenu' }); } }); }); $('.rimg').click(function () { if ($(this).parent().attr('href') == 'http://helpus.eset.com/') { ESETTrack.event('live-chat-support-click', 'event43', { 'eVar82': 'Live Chat Support|' + ESETAnalytics.current_url }); } }); $(document).on('click', '.btn', function () { label = $(this).text(); if (label.toLowerCase() == 'live chat support') { ESETTrack.event('live-chat-support-click', 'event43', { 'eVar82': label + '|' + ESETAnalytics.current_url }); } if (label.toLowerCase() == 'live chat sales') { ESETTrack.event('live-chat-support-click', 'event43', { 'eVar82': label + '|' + ESETAnalytics.current_url }); } }); }, addCartEvents: function () { $(document).bind("EsetCartEvent-AddedItem", function (obj, items) { cartContents = items; ESETTrack.event('cart-add', 'scAdd', { 'eVar44': items.added_items[0].sku + ':' + items.added_items[0].qty, 'eVar74': ESETAnalytics.current_url }); if (ESETAnalytics.sc_open == false) { ESETTrack.event('cart-open', 'scOpen'); ESETAnalytics.sc_open = true; ESETUtil.createCookie('esetck_sc_open', 1, 1); } }); $(document).bind("EsetCartEvent-RemovedItem", function (obj, sku) { for (var n = 0; typeof cartContents !== 'undefined' && cartContents && n < cartContents.items.length; n++) { var item = cartContents.items[n]; if (item.itemid === sku) { cartContents.items.splice(n, 1); break; } } ESETTrack.event('cart-remove', 'scRemove', { 'eVar47': sku }); }); $('.ficon-cart').mouseover(function () { ESETTrack.event('main-nav-icon', 'event11', { 'eVar14': 'Cart' }); ESETTrack.event('minicart', 'event29', { 'eVar57': ESETAnalytics.current_url }); ESETTrack.event('cart-view', 'scView'); }); $(document).on('click', '#flyout-cart a.btn-goto-cart', function (ev) { var itemCount, hasPromo = false, item, sku, qty; ESETTrack.event('minicart-checkout', 'event30', { 'eVar57': ESETAnalytics.current_url }); // If conditions are right, show upsell dialog // check cart cookie if (typeof cartContents !== 'undefined' && cartContents) { itemCount = cartContents.items.length; hasPromo = (cartContents.summary.promoapplied) ? true : false; if (itemCount === 1) { item = cartContents.items[0]; sku = item.itemid; qty = item.quantity; } } else { itemCount = $('#flyout-cart .cart-items li').length; if (itemCount === 1) { item = $('#flyout-cart .cart-items li')[0]; sku = $(item).data('itemid'); qty = $('h4.description span.quantity', $(item)).html(); qty = (qty) ? qty.match(/\d+/)[0] : 1; qty = Number(qty); } } if (itemCount && itemCount === 1 && !hasPromo && qty && sku) { var skuSplit = sku.split('-'); console.log(skuSplit); switch (skuSplit[0]) { case 'EAVH': case 'ECS': case 'ECSP': case 'ESSH': if (skuSplit[1] && skuSplit[1].substring(0,1) === 'N') { ev.preventDefault(); ev.stopPropagation(); ESETAnalytics.showUpsell(); break; } } } }); $(document).on('click', '#flyout-cart button.remove', function () { ESETTrack.event('minicart-remove-item', 'event31', { 'eVar57': ESETAnalytics.current_url }); }); }, showUpsell: function () { window.location.href = '/us/cart-summary/'; }, /** * Tracks download events, whether trial or full license */ addDownloadEvents: function () { var wcCookie = (ESETUtil.readCookie("esetck_wc")) ? "-" + ESETUtil.readCookie("esetck_wc") : ""; function pushTrialEvent(prod) { switch (prod) { case "eav": dataLayer.push({ "event": "product_trial_eav" }); break; case "http://download.eset.com/special/live-installer/us/eset_nod32_antivirus_live_installer.exe": case "eavl": case "eav-linux": dataLayer.push({ "event": "product_trial_eavl" }); break; case "http://download.eset.com/special/live-installer/us/eset_smart_security_live_installer.exe": case "ess": dataLayer.push({ "event": "product_trial_ess" }); break; case "http://download.eset.com/download/mac/ecs/eset_cybersecurity_en.dmg": case "ecs": dataLayer.push({ "event": "product_trial_ecs" }); break; case "http://download.eset.com/download/mac/ecsp/eset_cybersecurity_pro_en.dmg": case "ecsp": dataLayer.push({ "event": "product_trial_ecsp" }); break; case "ems": dataLayer.push({ "event": "product_trial_ems" }); break; } } // Download page trial downloads $(".product-tile-download a.btn-learn-more").click(function (e) { // get name of product being downloaded var prodName = $(this).parent().siblings(".product-data").find("h3.name").text().replace("®", "").replace("for Android", "").replace(/[0-9]+ (for Linux)/, "$1").trim(); if (prodName) { ESETTrack.event("download-page-trial", "event21", { "eVar83": "download", "eVar6": prodName + wcCookie }); } dataLayer.push({ "event": "product_trial_all" }); pushTrialEvent($(this).attr("href").toLowerCase()); }); // Download page full downloads $(".product-tile-download a.btn-buy").click(function (e) { // get name of product being downloaded var prodName = $(this).parent().siblings(".product-data").find("h3.name").text().replace("®", "").replace("for Android", "").replace(/[0-9]+ (for Linux)/, "$1").trim(); if (prodName) { ESETTrack.event("download-page-full-license", "event22", { "eVar83": "download", "eVar75": prodName }); } }); // All products page trial downloads /*$(".product-tile a:contains(Try)").click(function (e) { // get name of product being downloaded var prodName = $(this).siblings("h3.name").text().trim(); if (prodName) { ESETTrack.event("view-all-trial", "event21", { "eVar83": "view-all", "eVar6": prodName + wcCookie }); } dataLayer.push({ "event": "product_trial_all" }); pushTrialEvent($(this).attr("href").toLowerCase()); });*/ // Free trial page downloads if (ESETAnalytics.current_url.indexOf("free-trial") !== -1) { $(".btn-download").click(downloadAnalytics); } // Product page downloads $(".step-liveinstaller .btn-download").click(downloadAnalytics); function downloadAnalytics(e) { //var prodName = $(this).closest("form").siblings("h2.section-title").text().replace("Download", "").trim(); var classList = this.className.split(/\s+/), downloadType, prodAbbr, prodName, version; for (var n = 0; n < classList.length; n++) { if (classList[n].substring(0,6) === "widget"){ var classSplit = classList[n].split("-"); if (classSplit.length >= 4) { // get download type downloadType = classSplit[1]; // get name of product being downloaded prodAbbr = classSplit[3]; if (classSplit[4]) { version = classSplit[4]; } break; } } } switch (prodAbbr) { case "eavl": prodName = "ESET NOD32 Antivirus for Linux"; break; case "eav": prodName = "ESET NOD32 Antivirus"; switch (version) { case "linux": prodName += " for Linux"; break; } break; case "ess": prodName = "ESET Smart Security"; break; case "ecs": prodName = "ESET Cyber Security"; break; case "ecsp": prodName = "ESET Cyber Security Pro"; break; case "ems": prodName = "ESET Mobile Security"; break; case "eeal": prodName = "ESET Endpoint Antivirus for Linux"; break; case "eea": prodName = "ESET Endpoint Antivirus"; switch (version) { case "osx": case "mac": prodName += " for OS X"; break; case "linux": prodName += " for Linux"; break; default: prodName += " for Windows"; } break; case "ees": prodName = "ESET Endpoint Security"; switch (version) { case "osx": case "mac": prodName += " for OS X"; break; case "android": prodName += " for Android"; break; default: prodName += " for Windows"; } break; case "eraserver": prodName = "ESET Remote Administrator 5 Server"; break; case "eraconsole": prodName = "ESET Remote Administrator 5 Console"; break; case "era6": prodName = "ESET Remote Administrator 6"; switch (version) { case "all": prodName += " All-in-one"; break; case "standalone": prodName += " Standalone"; break; case "virtual": prodName += " Virtual Appliances"; break; } break; case "eralabtech": prodName = "ESET Remote Administrator Plug-in for LabTech"; break; case "era": prodName = "ESET Remote Administrator"; switch (version) { case "5server": prodName += " 5 Server"; break; case "5console": prodName += " 5 Console"; break; case "6allinone": prodName += " 6 All-in-one"; break; case "6standalone": prodName += " 6 Standalone"; break; case "6virtualappliances": prodName += " 6 Virtual Appliances"; break; case "kaseya": prodName += " Plug-in for Kaseya"; break; case "labtech": prodName += " Plug-in for LabTech"; break; } break; case "esa": prodName = "ESET Secure Authentication"; break; case "emails": prodName = "ESET Mail Security for Microsoft Exchange Server"; break; case "emslinux": prodName = "ESET Mail Security for Linux / BSD / Solaris"; break; case "emsl": prodName = "ESET Mail Security for IBM Lotus Domino"; break; case "mail": prodName = "ESET Mail Security"; switch (version) { case "ms": prodName += " for Microsoft Exchange Server"; break; case "linux": prodName += " for Linux / BSD / Solaris"; break; case "lotus": prodName += " for IBM Lotus Domino"; break; } break; case "efsm": prodName = "ESET File Security for Microsoft Windows Server"; break; case "efsl": prodName = "ESET File Security for Linux / BSD / Solaris"; break; case "efs": prodName = "ESET File Security"; switch (version) { case "ms": prodName += " for Microsoft Windows Server"; break; case "linux": prodName += " for Linux / BSD / Solaris"; break; } break; case "egsl": prodName = "ESET Gateway Security for Linux / BSD / Solaris"; break; case "egs": prodName = "ESET Gateway Security"; switch (version) { case "linux": prodName += " for Linux / BSD / Solaris"; break; } break; case "egsl": prodName = "ESET Gateway Security for Linux / BSD / Solaris"; break; case "egs": prodName = "ESET Gateway Security"; switch (version) { case "linux": prodName += " for Linux / BSD / Solaris"; break; } break; case "esk": prodName = "ESET Security for Kerio Server"; break; case "esms": prodName = "ESET Security for Microsoft SharePoint Server"; break; case "es": prodName = "ESET Security"; switch (version) { case "kerio": prodName += " for Kerio Server"; break; case "sharepoint": prodname += " for Microsoft SharePoint Server"; break; } break; } if (prodName && prodAbbr && downloadType) { // Product page trial downloads if (downloadType === "trial") { var trialProd = (version) ? prodAbbr + "-" + version : prodAbbr; if (ESETAnalytics.current_url.indexOf("free-trial") !== -1) { ESETTrack.event("free-trial", "event21", { "eVar83": "free-trial", "eVar6": prodName + wcCookie }); } else { ESETTrack.event("product-trial", "event21", { "eVar83": "product", "eVar6": prodName + wcCookie }); } dataLayer.push({ "event": "product_trial_all" }); pushTrialEvent(trialProd); // Product page full downloads } else if (downloadType === "purchased") { ESETTrack.event("product-download", "event22", { "eVar83": "product", "eVar75": prodName }); } } } // Product page advanced downloads $(".step-advanced a.btn-download-block").click(function (e) { // get name of product being downloaded var prodName = $(this).closest("form").siblings("h2.section-title").text().replace("Download", "").trim(), os = $(this).closest("form").find("select.pd-platform option:selected").text(), lang = $(this).closest("form").find("select.pd-language option:selected").text(); if (prodName) { ESETTrack.event("product-advanced-download", "event23", { "eVar83": "product", "eVar6": prodName + wcCookie + "|adv" }); } }); }, /** * Tracks form events */ addFormEvents: function () { // Form loaded $(document).one("DOMNodeInserted", ".powermail_form", function (ev) { srlLead = ($(this).find('#powermail_field_srllead').val()) ? $(this).find('#powermail_field_srllead').val() : '(blank)'; if (srlLead == 'Contact' || srlLead == 'Demo') { ESETAnalytics.tntConversion('mbx_business_contact_form_loaded'); } else if (srlLead == 'Trial') { ESETAnalytics.tntConversion('mbx_business_trial_form_loaded'); } if (!$(this).hasClass('form-contact-support')) { var formName = ($(this).find('#powermail_field_elqformname').val()) ? $('#powermail_field_elqformname').val() : '(blank)', ls = typeof ESETLeadSource == 'object' ? ESETLeadSource.getLeadSource() : '', cta = ($(this).find('button[type="submit"]').html()) ? $(this).find('button[type="submit"]').html() : '(unknown)', action = ($(this).attr('action')) ? $(this).attr('action') : '(unknown)'; if (ls) { $(this).find('#powermail_field_leadsource').val(ls); } else { ls = ($(this).find('#powermail_field_leadsource').val()) ? $(this).find('#powermail_field_leadsource').val() : '(blank)'; } // Page Load ESETTrack.event('form-loaded', 'event27', { 'eVar3': ls, 'eVar5': formName }); } }); // Form Started $(document).on("EsetCustomFormEvent-Editing", ".powermail_form", function () { if (!$(this).hasClass('form-contact-support')) { var formName = ($(this).find('#powermail_field_elqformname').val()) ? $('#powermail_field_elqformname').val() : '(blank)', ls = ($(this).find('#powermail_field_leadsource').val()) ? $(this).find('#powermail_field_leadsource').val() : '(blank)'; ESETTrack.event('form-started', 'event28', { 'eVar3': ls, 'eVar5': formName }); } }); // Form Submitted $(document).on("EsetCustomFormEvent-Submit", ".powermail_form", function (ev) { if (!$(this).hasClass('form-contact-support')) { var formName = ($(this).find('#powermail_field_elqformname').val()) ? $('#powermail_field_elqformname').val() : '(blank)', //cta = ($(this).find('button[type="submit"]').html()) ? $(this).find('button[type="submit"]').html() : '(unknown)', //action = ($(this).attr('action')) ? $(this).attr('action').split('?')[0] : '(unknown)', action = current_url, ws = ($(this).find('#powermail_field_workstations').val()) ? $(this).find('#powermail_field_workstations').val() : '(blank)', srlLead = ($(this).find('#powermail_field_srllead').val()) ? $(this).find('#powermail_field_srllead').val() : '(blank)', servers = [], email = ($(this).find('#powermail_field_emailaddress').val()) ? $(this).find('#powermail_field_emailaddress').val() : '(blank)', leadType = '', emailHash = ESETUtil.getEmailHash(email), dbData = [], ls = ($(this).find('#powermail_field_leadsource').val()) ? $(this).find('#powermail_field_leadsource').val() : '(blank)'; if (!ls) { $('#powermail_field_leadsource').val(ls); } else if (ESETUtil.getGET('leadsource')) { // TO DO $('#powermail_field_leadsource').val(ESETUtil.getGET('leadsource')); } var ls_list = ''; if (ESETUtil.readCookie('esetck_ls_list')) { var ls_list = ESETUtil.readCookie('esetck_ls_list'); ESETUtil.eraseCookie('esetck_ls_list'); ESETUtil.eraseCookie('esetck_ls'); } if (srlLead == 'Contact' || srlLead == 'Demo') { ESETAnalytics.tntConversion( 'mbx_eset_form_info_submitted' ); leadType = 'SRL'; dataLayer.push({ 'event': 'Business_Contact_SRL_Form_TY', 'lead_id': emailHash }); } else if (srlLead == 'Trial') { ESETAnalytics.tntConversion( 'mbx_eset_form_trial_submitted' ); leadType = 'SRL'; dataLayer.push({ 'event': 'Business_Trial_SRL_Form_TY', 'lead_id': emailHash }); } else if (srlLead == 'Asset') { leadType = 'MRL'; dataLayer.push({ 'event': 'MRL_Form_TY', 'lead_id': emailHash }); } else { leadType = ''; } // Lead_id dbData.push({ name: "email", value: email }); dbData.push({ name: "emailHash", value: emailHash }); dbData.push({ name: "leadsource", value: ls }); dbData.push({ name: "leadType", value: leadType }); dbData.push({ name: "srlLead", value: srlLead }); dbData.push({ name: "workstations", value: ws }); dbData.push({ name: "ls_list", value: ls_list }); $.ajax({ url: "/us/request/SRL", type: "POST", data: dbData }); // Tracking ESETTrack.event('form-submitted', 'event9', { 'eVar3': ls, 'eVar5': formName, 'eVar31': srlLead, 'eVar32': action }); switch (ws) { case '1': ws = '1-to-4'; break; case '2': ws = '5-to-24'; break; case '3': ws = '25-to-49'; break; case '4': ws = '50-to-99'; break; case '5': ws = '100-to-249'; break; case '10': ws = '250-to-499'; break; case '6': ws = '500-to-999'; break; case '7': ws = '1000-to-1999'; break; case '11': ws = '2000-to-49'; break; case '8': ws = '5000-to-9999'; break; case '9': ws = '10000+'; break; default: } if (srlLead.toLowerCase().trim() === 'trial') { // Number of workstations ESETTrack.event(formName + '-submitted', 'event39', { 'eVar26': ws }); } else if (srlLead.toLowerCase().trim() === 'contact') { // Number of workstations ESETTrack.event(formName + '-submitted', 'event40', { 'eVar27': ws }); } else if (srlLead.toLowerCase().trim() === 'asset') { ESETTrack.event(formName + '-submitted', 'event46', { 'eVar28': '' }); } // servers for (var n = 1; n < 20; n++) { if ($('#powermail_field_servers_' + n).length) { if ($('#powermail_field_servers_' + n + ':checked').length) { servers.push($('#powermail_field_servers_' + n)[0]); } } else { break; } } if (servers.length === 1) { switch ($(servers[0]).val()) { case '4': // ESA ESETTrack.event('interest-esa', 'event36'); break; case '8': // DESlock ESETTrack.event('interest-deslock', 'event38'); break; default: } } } }); }, /** * Tracks form events - Unbounce */ addUnbounceFormEvents: function () { // Form Loaded and Started var srlLead = ($('#srlLead').val()) ? $('#srlLead').val() : '(blank)'; if( srlLead == 'Contact' || srlLead == 'Demo' || srlLead == 'Trial') { ESETTrack.event('form-loaded', 'event27'); $("#lp-pom-form-57 form").one("change", ":input", function() { ESETTrack.event('form-started', 'event28'); }); } var ls = typeof ESETLeadSource == 'object' ? ESETLeadSource.getLeadSource() : ''; if (ls) { $('#leadsource').val(ls); } else { ls = ($('#leadsource').val()) ? $('#leadsource').val() : '(blank)'; } // Form Submitted var isFormSubmitted = (ESETUtil.getGET('elqFormName')) ? true : false; if( isFormSubmitted ) { var formName = (ESETUtil.getGET('elqFormName')) ? ESETUtil.getGET('elqFormName') : '(blank)', action = ESETAnalytics.current_url, ws = (ESETUtil.getGET('workstations')) ? ESETUtil.getGET('workstations') : '(blank)', srlLead = (ESETUtil.getGET('srlLead')) ? ESETUtil.getGET('srlLead') : '(blank)', servers = [], email = (ESETUtil.getGET('emailAddress')) ? ESETUtil.getGET('emailAddress') : '(blank)', leadType = '', emailHash = ESETUtil.getEmailHash(email), dbData = [], ls = (ESETUtil.getGET('leadsource')) ? ESETUtil.getGET('leadsource') : '(blank)'; var ls_list = ''; if (ESETUtil.readCookie('esetck_ls_list')) { var ls_list = ESETUtil.readCookie('esetck_ls_list'); ESETUtil.eraseCookie('esetck_ls_list'); ESETUtil.eraseCookie('esetck_ls'); } if (srlLead == 'Contact' || srlLead == 'Demo') { ESETAnalytics.tntConversion( 'mbx_eset_form_info_submitted' ); leadType = 'SRL'; dataLayer.push({ 'event': 'Business_Contact_SRL_Form_TY', 'lead_id': emailHash }); } else if (srlLead == 'Trial') { ESETAnalytics.tntConversion( 'mbx_eset_form_trial_submitted' ); leadType = 'SRL'; dataLayer.push({ 'event': 'Business_Trial_SRL_Form_TY', 'lead_id': emailHash }); } else if (srlLead == 'Asset') { leadType = 'MRL'; dataLayer.push({ 'event': 'MRL_Form_TY', 'lead_id': emailHash }); } else { leadType = ''; } // Lead_id dbData.push({ name: "email", value: email }); dbData.push({ name: "emailHash", value: emailHash }); dbData.push({ name: "leadsource", value: ls }); dbData.push({ name: "leadType", value: leadType }); dbData.push({ name: "srlLead", value: srlLead }); dbData.push({ name: "workstations", value: ws }); dbData.push({ name: "ls_list", value: ls_list }); $.ajax({ url: "http://www.eset.com/us/request/SRL", type: "POST", data: dbData }); // Tracking ESETTrack.event('form-submitted', 'event9', { 'eVar3': ls, 'eVar5': formName, 'eVar31': srlLead, 'eVar32': action }); switch (ws) { case '1': ws = '1-to-4'; break; case '2': ws = '5-to-24'; break; case '3': ws = '25-to-49'; break; case '4': ws = '50-to-99'; break; case '5': ws = '100-to-249'; break; case '10': ws = '250-to-499'; break; case '6': ws = '500-to-999'; break; case '7': ws = '1000-to-1999'; break; case '11': ws = '2000-to-49'; break; case '8': ws = '5000-to-9999'; break; case '9': ws = '10000+'; break; default: } if (srlLead.toLowerCase().trim() === 'trial') { // Number of workstations ESETTrack.event(formName + '-submitted', 'event39', { 'eVar26': ws }); } else if (srlLead.toLowerCase().trim() === 'contact') { // Number of workstations ESETTrack.event(formName + '-submitted', 'event40', { 'eVar27': ws }); } else if (srlLead.toLowerCase().trim() === 'asset') { ESETTrack.event(formName + '-submitted', 'event46', { 'eVar28': '' }); } // servers /* TO DO LATER for (var n = 1; n < 20; n++) { if ($('#servers_' + n).length) { if ($('#servers_' + n + ':checked').length) { servers.push($('#servers_' + n)[0]); } } else { break; } } if (servers.length === 1) { switch ($(servers[0]).val()) { case '4': // ESA ESETTrack.event('interest-esa', 'event36'); break; case '8': // DESlock ESETTrack.event('interest-deslock', 'event38'); break; default: } } */ } }, /** * Tracks actions in the Resources content browser */ addContentBrowserEvents: function () { var typeChecked = false, filters = ""; // Tracks the TYPE filters in the content browser $(".content-browser .facet-group-type input").click(function (ev) { if ($(this).is(":checked")) { var label = $(this).closest("label").find("a.hidden").text().trim(); ESETTrack.event("filters-checked", "", { "eVar77": label }); } }); // Tracks video assets $(".content-browser").on("click", "li.item-video a", function (ev) { var assetName = $(this).closest("li.item-video").find("h3.title a").text().trim(); ESETTrack.event("asset-clicked", "", { "eVar79": "video|" + assetName }); }); // Tracks PDF assets $(".content-browser").on("click", "li.item-pdf a.media-pdf", function (ev) { var assetName = $(this).siblings(".meta").find("h3.title a").text().trim(), type = "pdf", pathArray = $(this).attr("href").split("/"); if (pathArray.length > 4) { type = pathArray[pathArray.length - 2]; } ESETTrack.event("asset-clicked", "", { "eVar79": type + "|" + assetName }); }); // Tracks PDF assets $(".content-browser").on("click", "li.item-pdf a.btn-listen", function (ev) { var assetName = $(this).siblings(".meta").find("h3.title a").text().trim(), type = "pdf", pathArray = $(this).attr("href").split("/"); if (pathArray.length > 4) { type = pathArray[pathArray.length - 2]; } ESETTrack.event("asset-clicked", "", { "eVar79": type + "|" + assetName }); }); // Tracks podcasts $(".content-browser").on("click", "li.item-podcast a", function (ev) { var assetName = $(this).closest("li.item-podcast").find("h3.title a").text().trim(); ESETTrack.event("asset-clicked", "", { "eVar79": "podcast|" + assetName }); }); } }; $(function () { ESETAnalytics.init(); }); })(jQuery); var ESETTrack = { // Javascript load timeouts js_try: 16, js_count: 0, js_timeout: 500, debug: false, /** * Tracks a page view * * @param string path URL path to track */ page: function (path, events, evars_and_props) { // Wait for JS to load if (typeof s_account != 'string' || typeof ga != 'function') { if (++this.js_count < this.js_try) { setTimeout(function () { ESETTrack.page(path, events, evars_and_props); }, ESETTrack.js_timeout); } return; } if (this.debug) { console.log('SiteCatalyst Track Page' + "\n" + 'name: ' + path + "\n" + 'events: ' + events + "\n" + 'evars_and_props: ' + evars_and_props); } // Sitecatalyst var s = this.getSCVars(events, evars_and_props); if (s) { // Pass to SC s.pageName = path; s.t(); } // Google Analtyics if (typeof ga == 'function') { try { ga('send', 'pageview', { 'page': path }); } catch (e) {} } }, /** * Tracks an event * * @param string path Event path to track */ event: function (path, events, evars_and_props) { // Wait for JS to load if (typeof s_account != 'string' || typeof ga != 'function') { if (++this.js_count < this.js_try) { setTimeout(function () { ESETTrack.event(path, events, evars_and_props); }, ESETTrack.js_timeout); } return; } if (this.debug) { var debugevar = []; if (typeof evars_and_props == 'object') { for (var evar_key in evars_and_props) { debugevar.push(evar_key + ': ' + evars_and_props[evar_key]); } } if (debugevar.length) { debugevar = debugevar.join(', '); } else { debugevar = 'n/a'; } console.log('SiteCatalyst Track Link' + "\n" + 'name: ' + path + "\n" + 'events: ' + events + "\n" + 'evars_and_props: ' + debugevar); } // Sitecatalyst var s = this.getSCVars(events, evars_and_props); if (s) { // Pass to SC s.tl(true, 'o', path); } // Google Analytics if (typeof ga == 'function') { var sp = path.split('/'); var category = 'undefined'; if (sp[1]) { category = sp[1]; } var action = 'undefined'; if (sp[2]) { action = sp[2]; } // Pass to GA try { ga('send', 'event', category, action, { 'page': path }); } catch (e) {} } }, /** * Prepares the SiteCatalyst variables */ getSCVars: function (events, evars_and_props) { var s = false; if (typeof s_account == 'string' && typeof s_gi == 'function') { // Get SC account s = s_gi(s_account); // Clear exisiting variables s.linkTrackVars = 'None'; s.linkTrackEvents = 'None'; s.events = ''; // Array of variable names var s_evars = []; // Track events if (events) { s_evars.push('events'); s.linkTrackEvents = events; s.events = events; } // Track eVars if (typeof evars_and_props == 'object') { for (var evar_key in evars_and_props) { s_evars.push(evar_key); s[evar_key] = evars_and_props[evar_key]; } } // Build list of variable names if (s_evars.length) { s.linkTrackVars = s_evars.join(','); } } return s; } }; var ESETUtil = { getGET: function (name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)', 'i').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null }, getTLD: function () { var tld = window.location.host; tld = tld.split('.'); if (tld.length > 2) { tld = tld.slice(Math.max(tld.length - 2, 1)); } return tld.join('.'); }, getEmailHash: function (email) { var salt = "B@B2"; var emailHash = md5(md5(email + salt)); return emailHash; }, createCookie: function (name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/; domain=." + this.getTLD(); }, readCookie: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }, eraseCookie: function (name) { this.createCookie(name, "", -1); } }; /** MD5 Hash */ ! function (a) { "use strict"; function b(a, b) { var c = (65535 & a) + (65535 & b), d = (a >> 16) + (b >> 16) + (c >> 16); return d << 16 | 65535 & c } function c(a, b) { return a << b | a >>> 32 - b } function d(a, d, e, f, g, h) { return b(c(b(b(d, a), b(f, h)), g), e) } function e(a, b, c, e, f, g, h) { return d(b & c | ~b & e, a, b, f, g, h) } function f(a, b, c, e, f, g, h) { return d(b & e | c & ~e, a, b, f, g, h) } function g(a, b, c, e, f, g, h) { return d(b ^ c ^ e, a, b, f, g, h) } function h(a, b, c, e, f, g, h) { return d(c ^ (b | ~e), a, b, f, g, h) } function i(a, c) { a[c >> 5] |= 128 << c % 32, a[(c + 64 >>> 9 << 4) + 14] = c; var d, i, j, k, l, m = 1732584193, n = -271733879, o = -1732584194, p = 271733878; for (d = 0; d < a.length; d += 16) i = m, j = n, k = o, l = p, m = e(m, n, o, p, a[d], 7, -680876936), p = e(p, m, n, o, a[d + 1], 12, -389564586), o = e(o, p, m, n, a[d + 2], 17, 606105819), n = e(n, o, p, m, a[d + 3], 22, -1044525330), m = e(m, n, o, p, a[d + 4], 7, -176418897), p = e(p, m, n, o, a[d + 5], 12, 1200080426), o = e(o, p, m, n, a[d + 6], 17, -1473231341), n = e(n, o, p, m, a[d + 7], 22, -45705983), m = e(m, n, o, p, a[d + 8], 7, 1770035416), p = e(p, m, n, o, a[d + 9], 12, -1958414417), o = e(o, p, m, n, a[d + 10], 17, -42063), n = e(n, o, p, m, a[d + 11], 22, -1990404162), m = e(m, n, o, p, a[d + 12], 7, 1804603682), p = e(p, m, n, o, a[d + 13], 12, -40341101), o = e(o, p, m, n, a[d + 14], 17, -1502002290), n = e(n, o, p, m, a[d + 15], 22, 1236535329), m = f(m, n, o, p, a[d + 1], 5, -165796510), p = f(p, m, n, o, a[d + 6], 9, -1069501632), o = f(o, p, m, n, a[d + 11], 14, 643717713), n = f(n, o, p, m, a[d], 20, -373897302), m = f(m, n, o, p, a[d + 5], 5, -701558691), p = f(p, m, n, o, a[d + 10], 9, 38016083), o = f(o, p, m, n, a[d + 15], 14, -660478335), n = f(n, o, p, m, a[d + 4], 20, -405537848), m = f(m, n, o, p, a[d + 9], 5, 568446438), p = f(p, m, n, o, a[d + 14], 9, -1019803690), o = f(o, p, m, n, a[d + 3], 14, -187363961), n = f(n, o, p, m, a[d + 8], 20, 1163531501), m = f(m, n, o, p, a[d + 13], 5, -1444681467), p = f(p, m, n, o, a[d + 2], 9, -51403784), o = f(o, p, m, n, a[d + 7], 14, 1735328473), n = f(n, o, p, m, a[d + 12], 20, -1926607734), m = g(m, n, o, p, a[d + 5], 4, -378558), p = g(p, m, n, o, a[d + 8], 11, -2022574463), o = g(o, p, m, n, a[d + 11], 16, 1839030562), n = g(n, o, p, m, a[d + 14], 23, -35309556), m = g(m, n, o, p, a[d + 1], 4, -1530992060), p = g(p, m, n, o, a[d + 4], 11, 1272893353), o = g(o, p, m, n, a[d + 7], 16, -155497632), n = g(n, o, p, m, a[d + 10], 23, -1094730640), m = g(m, n, o, p, a[d + 13], 4, 681279174), p = g(p, m, n, o, a[d], 11, -358537222), o = g(o, p, m, n, a[d + 3], 16, -722521979), n = g(n, o, p, m, a[d + 6], 23, 76029189), m = g(m, n, o, p, a[d + 9], 4, -640364487), p = g(p, m, n, o, a[d + 12], 11, -421815835), o = g(o, p, m, n, a[d + 15], 16, 530742520), n = g(n, o, p, m, a[d + 2], 23, -995338651), m = h(m, n, o, p, a[d], 6, -198630844), p = h(p, m, n, o, a[d + 7], 10, 1126891415), o = h(o, p, m, n, a[d + 14], 15, -1416354905), n = h(n, o, p, m, a[d + 5], 21, -57434055), m = h(m, n, o, p, a[d + 12], 6, 1700485571), p = h(p, m, n, o, a[d + 3], 10, -1894986606), o = h(o, p, m, n, a[d + 10], 15, -1051523), n = h(n, o, p, m, a[d + 1], 21, -2054922799), m = h(m, n, o, p, a[d + 8], 6, 1873313359), p = h(p, m, n, o, a[d + 15], 10, -30611744), o = h(o, p, m, n, a[d + 6], 15, -1560198380), n = h(n, o, p, m, a[d + 13], 21, 1309151649), m = h(m, n, o, p, a[d + 4], 6, -145523070), p = h(p, m, n, o, a[d + 11], 10, -1120210379), o = h(o, p, m, n, a[d + 2], 15, 718787259), n = h(n, o, p, m, a[d + 9], 21, -343485551), m = b(m, i), n = b(n, j), o = b(o, k), p = b(p, l); return [m, n, o, p] } function j(a) { var b, c = ""; for (b = 0; b < 32 * a.length; b += 8) c += String.fromCharCode(a[b >> 5] >>> b % 32 & 255); return c } function k(a) { var b, c = []; for (c[(a.length >> 2) - 1] = void 0, b = 0; b < c.length; b += 1) c[b] = 0; for (b = 0; b < 8 * a.length; b += 8) c[b >> 5] |= (255 & a.charCodeAt(b / 8)) << b % 32; return c } function l(a) { return j(i(k(a), 8 * a.length)) } function m(a, b) { var c, d, e = k(a), f = [], g = []; for (f[15] = g[15] = void 0, e.length > 16 && (e = i(e, 8 * a.length)), c = 0; 16 > c; c += 1) f[c] = 909522486 ^ e[c], g[c] = 1549556828 ^ e[c]; return d = i(f.concat(k(b)), 512 + 8 * b.length), j(i(g.concat(d), 640)) } function n(a) { var b, c, d = "0123456789abcdef", e = ""; for (c = 0; c < a.length; c += 1) b = a.charCodeAt(c), e += d.charAt(b >>> 4 & 15) + d.charAt(15 & b); return e } function o(a) { return unescape(encodeURIComponent(a)) } function p(a) { return l(o(a)) } function q(a) { return n(p(a)) } function r(a, b) { return m(o(a), o(b)) } function s(a, b) { return n(r(a, b)) } function t(a, b, c) { return b ? c ? r(b, a) : s(b, a) : c ? p(a) : q(a) } "function" == typeof define && define.amd ? define(function () { return t }) : a.md5 = t }(this);