1var Config = function () { 2 3 var debugEnabled = window.location.hostname.toLowerCase().indexOf("localhost") != "-1" 4 || window.location.hostname.toLowerCase().indexOf("pruebas") != "-1"; 5 return { 6 debug: function () { return debugEnabled; }, 7 LogMessage: function (msg) { 8 if (debugEnabled) { 9 console.debug(msg); 10 } 11 } 12 } 13} 14 15var config = new Config(); 16config.LogMessage("Debug Enabled"); 17 18//Función para lanzar eventos de botones en Analytics 19$(function () { 20 21 Sys.Application.add_init(InitAnalytics); 22 23 function InitAnalytics() { 24 BindButtons(); 25 Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BindButtons); 26 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(BindButtons); 27 } 28 29 function BindButtons() { 30 var objects = $('[data-ga-event]'); 31 if (objects != null) { 32 $.each(objects, function (k, v) { 33 var elem = $(this); 34 elem.click(function () { 35 var obj = $(this); 36 var event = obj.attr('data-ga-event'); 37 var category = obj.attr('data-ga-category'); 38 var action = obj.attr('data-ga-action'); 39 if (action != null && category != null && action != null) { 40 if (typeof ga != "undefined") { 41 ga('send', 'event', event, category, action); 42 console.debug('Lanzando evento: ' + event + ' ' + category + ' ' + action); 43 } 44 } 45 }); 46 }); 47 } 48 } 49 50}); 51 52 53 54function SendCustomPageView(pageName, values, Cia, NomCia) { 55 $(function () { 56 if (typeof ga != undefined) { 57 58 if (values != undefined) { 59 $.each(values, function (index, value) { 60 ga('set', value.name, value.value); 61 //console.log("ga -> set ->" + index + " - " + value); 62 }); 63 config.LogMessage("Custom Dimensions ->" + JSON.stringify(values)); 64 } 65 //Lanzamos pageview manual 66 config.LogMessage('Custom page ->' + pageName); 67 ga('send', 'pageview', pageName); 68 69 if (Cia != null && Cia == 100) { 70 if(NomCia == null) 71 trackConvAdwords(pageName); 72 } 73 } 74 if (typeof fbq != "undefined") { 75 fbq('trackCustom', 'UrlVirtual', { custom_param1: pageName }); 76 } 77 }); 78} 79 80 81function trackConv(google_conversion_label) { 82 var image = new Image(1, 1); 83 image.src = "https://www.googleadservices.com/pagead/conversion/1046043128/?label=" + google_conversion_label + "&guid=ON&script=0"; 84 config.LogMessage("Tracking conversion -> " + google_conversion_label); 85 86} 87 88function trackConvAdwords(label) { 89 var image = new Image(1, 1); 90 image.src = "https://googleads.g.doubleclick.net/pagead/viewthroughconversion/1046043128/?value=" + label + "&guid=ON&script=0"; 91 config.LogMessage("Tracking Adwords -> " + label); 92 93} 94
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.