Google Analytics for WordPress by MonsterInsights - Version 6.0.16

Version Description

= 6.0.0 =

This is a major release. Please back up your site before upgrading.

Download this release

Release Info

Developer chriscct7
Plugin Icon 128x128 Google Analytics for WordPress by MonsterInsights
Version 6.0.16
Comparing to
See all releases

Code changes from version 6.0.15 to 6.0.16

assets/js/frontend.js CHANGED
@@ -10,11 +10,19 @@
10
  *
11
  * @since 6.0.12
12
  */
13
- (function(){
14
  // MonsterInsights JS events tracking works on all major browsers, including IE starting at IE 7, via polyfills for any major JS fucntion used that
15
  // is not supported by at least 95% of the global and/or US browser marketshare. Currently, IE 7 & 8 which as of 2/14/17 have under 0.25% global marketshare, require
16
  // us to polyfill Array.prototype.lastIndexOf, and if they continue to drop, we might remove this polyfill at some point. In that case note that events tracking
17
  // for IE 7/8 will continue to work, with the exception of events tracking of downloads.
 
 
 
 
 
 
 
 
18
  function __gaTrackerClickEventPHP() {
19
  var debug_mode = false;
20
  if ( monsterinsights_frontend.is_debug_mode === "true" ) {
@@ -42,26 +50,30 @@
42
  return phpvalues;
43
  }
44
 
45
- function __gaTrackerClickEvent( event ) {
46
  var phpvalues = __gaTrackerClickEventPHP();
47
  var is_debug_mode = phpvalues.is_debug_mode || window.monsterinsights_debug_mode; /* Console log instead of running? */
48
- var el = event.srcElement || event.target;
49
  if ( is_debug_mode ) {
50
- console.log( "__gaTracker.hasOwnProperty(loaded)" );
51
- console.log( __gaTracker.hasOwnProperty( "loaded" ) );
52
- console.log( "__gaTracker.loaded" );
53
- console.log( __gaTracker.loaded );
54
- console.log( "Event.which: " + event.which );
55
- console.log( "El: ");
56
- console.log( el );
57
- console.log( "GA Loaded and click: " + ! ( ! __gaTracker.hasOwnProperty( "loaded" ) || __gaTracker.loaded != true || ( event.which != 1 && event.which != 2 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey ) ) ) ;
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  /* If GA is blocked or not loaded, or not main|middle|touch click then don't track */
61
  if ( ! __gaTracker.hasOwnProperty( "loaded" ) || __gaTracker.loaded != true || ( event.which != 1 && event.which != 2 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey ) ) {
62
- if ( is_debug_mode ) {
63
- console.log( "Will track: false");
64
- }
65
  return;
66
  }
67
 
@@ -91,9 +103,7 @@
91
  var track_download_as = phpvalues.track_download_as; /* should downloads be tracked as events or pageviews */
92
  var internal_label = phpvalues.internal_label; /* What is the prefix for internal-as-external links */
93
 
94
- if ( is_debug_mode ) {
95
- console.log( "Will track: true");
96
- }
97
 
98
  /* Remove the anchor at the end, if there is one */
99
  extension = extension.substring( 0, (extension.indexOf( "#" ) == -1 ) ? extension.length : extension.indexOf( "#" ) );
@@ -215,14 +225,14 @@
215
  return x.replace(/^\s+|\s+$/gm,'');
216
  }
217
 
218
- if ( is_debug_mode ) {
219
- console.log( "Link: " + link);
220
- console.log( "Extension: " + extension );
221
- console.log( "Protocol: " + el.protocol );
222
- console.log( "External: " + (el.hostname.length > 0 && currentdomain.length > 0 && ! el.hostname.endsWith( currentdomain )) );
223
- console.log( "Current domain: " + currentdomain );
224
- console.log( "Link domain: " + el.hostname );
225
- }
226
 
227
  /* Let's get the type of click event this is */
228
  if ( monsterinsightsStringTrim( el.protocol ) == 'mailto' || monsterinsightsStringTrim( el.protocol ) == 'mailto:' ) { /* If it's an email */
@@ -235,16 +245,16 @@
235
  var index, len;
236
  var pathname = el.pathname;
237
  for ( index = 0, len = inbound_paths.length; index < len; ++index ) {
238
- if ( pathname.startsWith( inbound_paths[ index ] ) ) {
239
  type = "internal-as-outbound";
240
  break;
241
  }
242
  }
243
  }
244
 
245
- if ( is_debug_mode ) {
246
- console.log( "Type: " + type );
247
- }
248
 
249
  /* Let's track everything but internals (that aren't internal-as-externals) */
250
  if ( type !== 'internal' && ! link.match( /^javascript\:/i ) ) {
@@ -257,13 +267,12 @@
257
  target = "_blank";
258
  }
259
 
260
- if ( is_debug_mode ) {
261
- console.log( "Control Key: " + event.ctrlKey );
262
- console.log( "Shift Key: " + event.shiftKey );
263
- console.log( "Meta Key: " + event.metaKey );
264
- console.log( "Which Key: " + event.which );
265
- console.log( "Target: " + target );
266
- }
267
 
268
  var __gaTrackerHitBackRun = false; /* Tracker has not yet run */
269
 
@@ -280,131 +289,96 @@
280
  if ( target ) { /* If target opens a new window then just track */
281
  if ( type == 'download' ) {
282
  if ( track_download_as == 'pageview' ) {
283
- if ( ! is_debug_mode ) {
284
- __gaTracker( 'send', 'pageview', link );
285
- } else {
286
- console.log( "Target | Download | Send | Pageview | " + link );
287
- }
288
  } else {
289
- if ( ! is_debug_mode ) {
290
- __gaTracker( 'send', 'event', 'download', link );
291
- } else {
292
- console.log( "Target | Download | Send | Event | " + link );
293
- }
294
  }
295
  } else if ( type == 'mailto' ) {
296
- if ( ! is_debug_mode ) {
297
- __gaTracker( 'send', 'event', 'mailto', link );
298
- } else {
299
- console.log( "Target | Mailto | Send | Event | Mailto | " + link );
300
- }
301
-
302
  } else if ( type == 'internal-as-outbound' ) {
303
- if ( ! is_debug_mode ) {
304
- __gaTracker( 'send', 'event', internal_label, link, el.title );
305
- } else {
306
- console.log( "Target | Internal-As-Outbound | Send | event | " + internal_label + " | " + link + " | " + el.title );
307
- }
308
-
309
  } else if ( type == 'external' ) {
310
- if ( ! is_debug_mode ) {
311
- __gaTracker( 'send', 'event', 'outbound-link', link, el.title );
312
- } else {
313
- console.log( "Target | External | Send | 'outbound-link' | " + link + " | " + el.title );
314
- }
315
-
316
  } else {
317
- if ( is_debug_mode ) {
318
- console.log( "Target | " + type + " | " + link + " is not a tracked click." );
319
- }
320
  }
321
- } else { /* Prevent standard click, track then open */
 
 
322
  if (!event.defaultPrevented) {
323
  event.preventDefault ? event.preventDefault() : event.returnValue = !1;
324
  }
325
-
 
326
  if ( type == 'download' ) {
327
  if ( track_download_as == 'pageview' ) {
328
- if ( ! is_debug_mode ) {
329
- __gaTracker( 'send', 'pageview', link, { "hitCallback": __gaTrackerHitBack } );
330
- } else {
331
- console.log( "Not Target | Download | Send | Pageview | " + link );
332
- }
333
  } else {
334
- if ( ! is_debug_mode ) {
335
- __gaTracker( 'send', 'event', 'download',{ "hitCallback": __gaTrackerHitBack } );
336
- } else {
337
- console.log( "Not Target | Download | Send | Event | " + link );
338
- }
339
  }
340
-
341
  } else if ( type == 'mailto' ) {
342
- if ( ! is_debug_mode ) {
343
- __gaTracker( 'send', 'event', 'mailto', link, { "hitCallback": __gaTrackerHitBack } );
344
- } else {
345
- console.log( "Not Target | Mailto | Send | Event | Mailto | " + link );
346
- }
347
-
348
  } else if ( type == 'internal-as-outbound' ) {
349
  window.onbeforeunload = function(e) {
350
- if ( ! is_debug_mode ) {
351
- if ( ! navigator.sendBeacon ) {
352
- __gaTracker( 'send', 'event', internal_label, link, el.title, { "hitCallback": __gaTrackerHitBack } );
353
- } else {
354
- __gaTracker( 'send', 'event', internal_label, link, el.title, { transport: 'beacon' } );
355
- }
356
- setTimeout( __gaTrackerHitBack, 1000 );
357
  } else {
358
- console.log( "Not Target | Internal-As-Outbound | Send | event | " + internal_label + " | " + link + " | " + el.title );
359
- console.log( "Internal as Outbound: Not redirecting" );
360
  }
 
 
 
 
 
361
  };
362
- if ( is_debug_mode ) {
363
- console.log( "Internal as Outbound: Not redirecting" );
364
- }
365
  } else if ( type == 'external' ) {
366
  window.onbeforeunload = function(e) {
367
- if ( ! is_debug_mode ) {
368
- if ( ! navigator.sendBeacon ) {
369
- __gaTracker( 'send', 'event', 'outbound-link', link, el.title, { "hitCallback": __gaTrackerHitBack } )
370
- } else {
371
- __gaTracker( 'send', 'event', 'outbound-link', link, el.title, { transport: 'beacon' } )
372
- }
373
- setTimeout( __gaTrackerHitBack, 1000 );
374
  } else {
375
- console.log( "Not Target | External | Send | 'outbound-link' | " + link + " | " + el.title );
376
- console.log( "External: Redirecting" );
377
  }
 
 
 
 
 
378
  };
379
- if ( is_debug_mode ) {
380
- console.log( "External: Not redirecting" );
381
- }
382
  } else {
383
- if ( is_debug_mode ) {
384
- console.log( "Not Target | " + type + " | " + link + " is not a tracked click." );
385
- }
386
  }
387
 
388
- if ( ! is_debug_mode && ( type != 'external' && type != 'internal-as-outbound' ) ) {
389
- /* Run hitCallback again if GA takes longer than 1 second */
390
  setTimeout( __gaTrackerHitBack, 1000 );
391
- } else {
392
- if ( type != 'external' && type != 'internal-as-outbound' ) {
393
- window.location.href = link;
394
- }
395
  }
396
  }
397
  }
398
  } else {
399
- if ( is_debug_mode ) {
400
- console.log( "Will track: false");
401
- }
402
  }
403
  }
404
 
405
- var __gaTrackerWindow = window;
406
  var __gaTrackerEventType = "click";
407
  /* Attach the event to all clicks in the document after page has loaded */
408
  __gaTrackerWindow.addEventListener ? __gaTrackerWindow.addEventListener( "load", function() {document.body.addEventListener(__gaTrackerEventType, __gaTrackerClickEvent, false)}, false)
409
  : __gaTrackerWindow.attachEvent && __gaTrackerWindow.attachEvent("onload", function() {document.body.attachEvent( "on" + __gaTrackerEventType, __gaTrackerClickEvent)});
410
- })();
 
10
  *
11
  * @since 6.0.12
12
  */
13
+ var MonsterInsights = function(){
14
  // MonsterInsights JS events tracking works on all major browsers, including IE starting at IE 7, via polyfills for any major JS fucntion used that
15
  // is not supported by at least 95% of the global and/or US browser marketshare. Currently, IE 7 & 8 which as of 2/14/17 have under 0.25% global marketshare, require
16
  // us to polyfill Array.prototype.lastIndexOf, and if they continue to drop, we might remove this polyfill at some point. In that case note that events tracking
17
  // for IE 7/8 will continue to work, with the exception of events tracking of downloads.
18
+ var lastClicked = '';
19
+ this.setLastClicked = function(a){
20
+ lastClicked = a;
21
+ }
22
+ this.getLastClicked = function () {
23
+ return lastClicked;
24
+ }
25
+
26
  function __gaTrackerClickEventPHP() {
27
  var debug_mode = false;
28
  if ( monsterinsights_frontend.is_debug_mode === "true" ) {
50
  return phpvalues;
51
  }
52
 
53
+ function __gaTrackerLog ( message ) {
54
  var phpvalues = __gaTrackerClickEventPHP();
55
  var is_debug_mode = phpvalues.is_debug_mode || window.monsterinsights_debug_mode; /* Console log instead of running? */
 
56
  if ( is_debug_mode ) {
57
+ console.log( message );
 
 
 
 
 
 
 
58
  }
59
+ }
60
+
61
+ function __gaTrackerClickEvent( event ) {
62
+ var phpvalues = __gaTrackerClickEventPHP();
63
+ var el = event.srcElement || event.target;
64
+ __gaTrackerLog( "__gaTracker.hasOwnProperty(loaded)" );
65
+ __gaTrackerLog( __gaTracker.hasOwnProperty( "loaded" ) );
66
+ __gaTrackerLog( "__gaTracker.loaded" );
67
+ __gaTrackerLog( __gaTracker.loaded );
68
+ __gaTrackerLog( "Event.which: " + event.which );
69
+ __gaTrackerLog( "El: ");
70
+ __gaTrackerLog( el );
71
+ __gaTrackerLog( "GA Loaded and click: " + ! ( ! __gaTracker.hasOwnProperty( "loaded" ) || __gaTracker.loaded != true || ( event.which != 1 && event.which != 2 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey ) ) ) ;
72
 
73
  /* If GA is blocked or not loaded, or not main|middle|touch click then don't track */
74
  if ( ! __gaTracker.hasOwnProperty( "loaded" ) || __gaTracker.loaded != true || ( event.which != 1 && event.which != 2 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey ) ) {
75
+ __gaTrackerLog( "Will track: false");
76
+ lastClicked = 'ganlonte';
 
77
  return;
78
  }
79
 
103
  var track_download_as = phpvalues.track_download_as; /* should downloads be tracked as events or pageviews */
104
  var internal_label = phpvalues.internal_label; /* What is the prefix for internal-as-external links */
105
 
106
+ __gaTrackerLog("Will track: true");
 
 
107
 
108
  /* Remove the anchor at the end, if there is one */
109
  extension = extension.substring( 0, (extension.indexOf( "#" ) == -1 ) ? extension.length : extension.indexOf( "#" ) );
225
  return x.replace(/^\s+|\s+$/gm,'');
226
  }
227
 
228
+ __gaTrackerLog( "Link: " + link);
229
+ __gaTrackerLog( "Extension: " + extension );
230
+ __gaTrackerLog( "Protocol: " + el.protocol );
231
+ __gaTrackerLog( "External: " + (el.hostname.length > 0 && currentdomain.length > 0 && ! el.hostname.endsWith( currentdomain )) );
232
+ __gaTrackerLog( "Current domain: " + currentdomain );
233
+ __gaTrackerLog( "Link domain: " + el.hostname );
234
+ __gaTrackerLog( "Outbound Paths: " + inbound_paths );
235
+
236
 
237
  /* Let's get the type of click event this is */
238
  if ( monsterinsightsStringTrim( el.protocol ) == 'mailto' || monsterinsightsStringTrim( el.protocol ) == 'mailto:' ) { /* If it's an email */
245
  var index, len;
246
  var pathname = el.pathname;
247
  for ( index = 0, len = inbound_paths.length; index < len; ++index ) {
248
+ if ( inbound_paths[ index ].length > 0 && pathname.startsWith( inbound_paths[ index ] ) ) {
249
  type = "internal-as-outbound";
250
  break;
251
  }
252
  }
253
  }
254
 
255
+ lastClicked = type;
256
+
257
+ __gaTrackerLog( "Type: " + type );
258
 
259
  /* Let's track everything but internals (that aren't internal-as-externals) */
260
  if ( type !== 'internal' && ! link.match( /^javascript\:/i ) ) {
267
  target = "_blank";
268
  }
269
 
270
+ __gaTrackerLog( "Control Key: " + event.ctrlKey );
271
+ __gaTrackerLog( "Shift Key: " + event.shiftKey );
272
+ __gaTrackerLog( "Meta Key: " + event.metaKey );
273
+ __gaTrackerLog( "Which Key: " + event.which );
274
+ __gaTrackerLog( "Target: " + target );
275
+
 
276
 
277
  var __gaTrackerHitBackRun = false; /* Tracker has not yet run */
278
 
289
  if ( target ) { /* If target opens a new window then just track */
290
  if ( type == 'download' ) {
291
  if ( track_download_as == 'pageview' ) {
292
+ __gaTracker( 'send', 'pageview', link );
293
+ __gaTrackerLog( "Target | Download | Send | Pageview | " + link );
 
 
 
294
  } else {
295
+ __gaTracker( 'send', 'event', 'download', link );
296
+ __gaTrackerLog( "Target | Download | Send | Event | " + link );
 
 
 
297
  }
298
  } else if ( type == 'mailto' ) {
299
+ __gaTracker( 'send', 'event', 'mailto', link );
300
+ __gaTrackerLog( "Target | Mailto | Send | Event | Mailto | " + link );
 
 
 
 
301
  } else if ( type == 'internal-as-outbound' ) {
302
+ __gaTracker( 'send', 'event', internal_label, link, el.title );
303
+ __gaTrackerLog( "Target | Internal-As-Outbound | Send | event | " + internal_label + " | " + link + " | " + el.title );
 
 
 
 
304
  } else if ( type == 'external' ) {
305
+ __gaTracker( 'send', 'event', 'outbound-link', link, el.title );
306
+ __gaTrackerLog( "Target | External | Send | 'outbound-link' | " + link + " | " + el.title );
 
 
 
 
307
  } else {
308
+ __gaTrackerLog( "Target | " + type + " | " + link + " is not a tracked click." );
 
 
309
  }
310
+ } else {
311
+ /* Prevent standard click, track then open */
312
+ if ( type != 'external' && type != 'internal-as-outbound' ) {
313
  if (!event.defaultPrevented) {
314
  event.preventDefault ? event.preventDefault() : event.returnValue = !1;
315
  }
316
+ }
317
+
318
  if ( type == 'download' ) {
319
  if ( track_download_as == 'pageview' ) {
320
+ __gaTracker( 'send', 'pageview', link, { "hitCallback": __gaTrackerHitBack } );
321
+ __gaTrackerLog( "Not Target | Download | Send | Pageview | " + link );
 
 
 
322
  } else {
323
+ __gaTracker( 'send', 'event', 'download',{ "hitCallback": __gaTrackerHitBack } );
324
+ __gaTrackerLog( "Not Target | Download | Send | Event | " + link );
 
 
 
325
  }
 
326
  } else if ( type == 'mailto' ) {
327
+ __gaTracker( 'send', 'event', 'mailto', link, { "hitCallback": __gaTrackerHitBack } );
328
+ __gaTrackerLog( "Not Target | Mailto | Send | Event | Mailto | " + link );
 
 
 
 
329
  } else if ( type == 'internal-as-outbound' ) {
330
  window.onbeforeunload = function(e) {
331
+ if (!event.defaultPrevented) {
332
+ event.preventDefault ? event.preventDefault() : event.returnValue = !1;
333
+ }
334
+ if ( ! navigator.sendBeacon ) {
335
+ __gaTracker( 'send', 'event', internal_label, link, el.title, { "hitCallback": __gaTrackerHitBack } );
 
 
336
  } else {
337
+ __gaTracker( 'send', 'event', internal_label, link, el.title, { transport: 'beacon',"hitCallback": __gaTrackerHitBack } );
 
338
  }
339
+
340
+ setTimeout( __gaTrackerHitBack, 1000 );
341
+
342
+ __gaTrackerLog( "Not Target | Internal-As-Outbound | Send | event | " + internal_label + " | " + link + " | " + el.title );
343
+ __gaTrackerLog( "Internal as Outbound: Redirecting" );
344
  };
345
+ lastClicked = type;
346
+ __gaTrackerLog( "Internal as Outbound: Not redirecting" );
 
347
  } else if ( type == 'external' ) {
348
  window.onbeforeunload = function(e) {
349
+ if ( ! navigator.sendBeacon ) {
350
+ __gaTracker( 'send', 'event', 'outbound-link', link, el.title, { "hitCallback": __gaTrackerHitBack } )
 
 
 
 
 
351
  } else {
352
+ __gaTracker( 'send', 'event', 'outbound-link', link, el.title, { transport: 'beacon',"hitCallback": __gaTrackerHitBack } )
 
353
  }
354
+
355
+ setTimeout( __gaTrackerHitBack, 1000 );
356
+
357
+ __gaTrackerLog( "Not Target | External | Send | 'outbound-link' | " + link + " | " + el.title );
358
+ __gaTrackerLog( "External: Redirecting" );
359
  };
360
+ lastClicked = type;
361
+ __gaTrackerLog( "External: Not redirecting" );
 
362
  } else {
363
+ __gaTrackerLog( "Not Target | " + type + " | " + link + " is not a tracked click." );
 
 
364
  }
365
 
366
+ if ( type != 'external' && type != 'internal-as-outbound' ) {
367
+ /* Run hitCallback again if GA takes longer than 1 second */
368
  setTimeout( __gaTrackerHitBack, 1000 );
 
 
 
 
369
  }
370
  }
371
  }
372
  } else {
373
+ lastClicked = 'internal';
374
+ __gaTrackerLog( "Will track: false");
 
375
  }
376
  }
377
 
378
+ var __gaTrackerWindow = window;
379
  var __gaTrackerEventType = "click";
380
  /* Attach the event to all clicks in the document after page has loaded */
381
  __gaTrackerWindow.addEventListener ? __gaTrackerWindow.addEventListener( "load", function() {document.body.addEventListener(__gaTrackerEventType, __gaTrackerClickEvent, false)}, false)
382
  : __gaTrackerWindow.attachEvent && __gaTrackerWindow.attachEvent("onload", function() {document.body.attachEvent( "on" + __gaTrackerEventType, __gaTrackerClickEvent)});
383
+ };
384
+ var MonsterInsightsObject = new MonsterInsights();
assets/js/frontend.min.js CHANGED
@@ -1,31 +1,20 @@
1
- (function(){function o(){var t=!1;if(monsterinsights_frontend.is_debug_mode==="true"){t=!0};var e=[],n=[];if(typeof monsterinsights_frontend.download_extensions=="string"){n=monsterinsights_frontend.download_extensions.split(",")};if(typeof monsterinsights_frontend.inbound_paths=="string"){e=monsterinsights_frontend.inbound_paths.split(",")};var o={"is_debug_mode":t,"download_extensions":n,"inbound_paths":e,"home_url":monsterinsights_frontend.home_url,"track_download_as":monsterinsights_frontend.track_download_as,"internal_label":"outbound-link-"+monsterinsights_frontend.internal_label,};return o};function t(e){var s=o(),l=s.is_debug_mode||window.monsterinsights_debug_mode,n=e.srcElement||e.target;if(l){console.log("__gaTracker.hasOwnProperty(loaded)");console.log(__gaTracker.hasOwnProperty("loaded"));console.log("__gaTracker.loaded");console.log(__gaTracker.loaded);console.log("Event.which: "+e.which);console.log("El: ");console.log(n);console.log("GA Loaded and click: "+!(!__gaTracker.hasOwnProperty("loaded")||__gaTracker.loaded!=!0||(e.which!=1&&e.which!=2&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey)))};if(!__gaTracker.hasOwnProperty("loaded")||__gaTracker.loaded!=!0||(e.which!=1&&e.which!=2&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey)){if(l){console.log("Will track: false")};return}
2
- while(n&&(typeof n.tagName=="undefined"||n.tagName.toLowerCase()!="a"||!n.href)){n=n.parentNode};if(n&&n.href){var t=n.href,i=n.href,a="internal",m=s.download_extensions,p=s.inbound_paths,k=s.home_url,w=s.track_download_as,c=s.internal_label;if(l){console.log("Will track: true")};i=i.substring(0,(i.indexOf("#")==-1)?i.length:i.indexOf("#"));i=i.substring(0,(i.indexOf("?")==-1)?i.length:i.indexOf("?"));i=i.substring(i.lastIndexOf("/")+1,i.length);i=i.substring(i.indexOf(".")+1);var d=(function(){var t=0,e=document.domain,o=e.split("."),n="_gd"+(new Date()).getTime();while(t<(o.length-1)&&document.cookie.indexOf(n+"="+n)==-1){e=o.slice(-1-(++t)).join(".");document.cookie=n+"="+n+";domain="+e+";"};document.cookie=n+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+e+";";return e})();if(typeof String.prototype.endsWith!=="function"){String.prototype.endsWith=function(e){return this.indexOf(e,this.length-e.length)!==-1}};if(typeof String.prototype.startsWith!=="function"){String.prototype.startsWith=function(e){return this.indexOf(e)===0}};if(typeof Array.prototype.includes!=="function"){Object.defineProperty(Array.prototype,"includes",{value:function(e,i){if(this==null){throw new TypeError("\"this\" is null or not defined")};var l=Object(this),o=l.length>>>0;if(o===0){return!1};var n=i|0,t=Math.max(n>=0?n:o-Math.abs(n),0);while(t<o){if(l[t]===e){return!0};t++};return!1}})};if(typeof Array.prototype.lastIndexOf!=="function"){Array.prototype.lastIndexOf=function(n){"use strict";if(this===void 0||this===null){throw new TypeError()};var e,t,l=Object(this),o=l.length>>>0;if(o===0){return-1};e=o-1;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}
3
- else if(e!=0&&e!=(1/0)&&e!=-(1/0)){e=(e>0||-1)*Math.floor(Math.abs(e))}};for(t=e>=0?Math.min(e,o-1):o-Math.abs(e);t>=0;t--){if(t in l&&l[t]===n){return t}};return-1}};function v(e){return e.replace(/^\s+|\s+$/gm,"")};if(l){console.log("Link: "+t);console.log("Extension: "+i);console.log("Protocol: "+n.protocol);console.log("External: "+(n.hostname.length>0&&d.length>0&&!n.hostname.endsWith(d)));console.log("Current domain: "+d);console.log("Link domain: "+n.hostname)};if(v(n.protocol)=="mailto"||v(n.protocol)=="mailto:"){a="mailto"}
4
- else if(m.length>0&&i.length>0&&m.includes(i)){a="download"}
5
- else if(n.hostname.length>0&&d.length>0&&!n.hostname.endsWith(d)){a="external"}
6
- else{var g,u,b=n.pathname;for(g=0,u=p.length;g<u;++g){if(b.startsWith(p[g])){a="internal-as-outbound";break}}};if(l){console.log("Type: "+a)};if(a!=="internal"&&!t.match(/^javascript\:/i)){var f=(n.target&&!n.target.match(/^_(self|parent|top)$/i))?n.target:!1;if(e.ctrlKey||e.shiftKey||e.metaKey||e.which==2){f="_blank"};if(l){console.log("Control Key: "+e.ctrlKey);console.log("Shift Key: "+e.shiftKey);console.log("Meta Key: "+e.metaKey);console.log("Which Key: "+e.which);console.log("Target: "+f)};var h=!1,r=function(){if(h){return};h=!0;window.location.href=t};if(f){if(a=="download"){if(w=="pageview"){if(!l){__gaTracker("send","pageview",t)}
7
- else{console.log("Target | Download | Send | Pageview | "+t)}}
8
- else{if(!l){__gaTracker("send","event","download",t)}
9
- else{console.log("Target | Download | Send | Event | "+t)}}}
10
- else if(a=="mailto"){if(!l){__gaTracker("send","event","mailto",t)}
11
- else{console.log("Target | Mailto | Send | Event | Mailto | "+t)}}
12
- else if(a=="internal-as-outbound"){if(!l){__gaTracker("send","event",c,t,n.title)}
13
- else{console.log("Target | Internal-As-Outbound | Send | event | "+c+" | "+t+" | "+n.title)}}
14
- else if(a=="external"){if(!l){__gaTracker("send","event","outbound-link",t,n.title)}
15
- else{console.log("Target | External | Send | 'outbound-link' | "+t+" | "+n.title)}}
16
- else{if(l){console.log("Target | "+a+" | "+t+" is not a tracked click.")}}}
17
- else{if(!e.defaultPrevented){e.preventDefault?e.preventDefault():e.returnValue=!1};if(a=="download"){if(w=="pageview"){if(!l){__gaTracker("send","pageview",t,{"hitCallback":r})}
18
- else{console.log("Not Target | Download | Send | Pageview | "+t)}}
19
- else{if(!l){__gaTracker("send","event","download",{"hitCallback":r})}
20
- else{console.log("Not Target | Download | Send | Event | "+t)}}}
21
- else if(a=="mailto"){if(!l){__gaTracker("send","event","mailto",t,{"hitCallback":r})}
22
- else{console.log("Not Target | Mailto | Send | Event | Mailto | "+t)}}
23
- else if(a=="internal-as-outbound"){window.onbeforeunload=function(e){if(!l){if(!navigator.sendBeacon){__gaTracker("send","event",c,t,n.title,{"hitCallback":r})}
24
- else{__gaTracker("send","event",c,t,n.title,{transport:"beacon"})};setTimeout(r,1000)}
25
- else{console.log("Not Target | Internal-As-Outbound | Send | event | "+c+" | "+t+" | "+n.title);console.log("Internal as Outbound: Not redirecting")}};if(l){console.log("Internal as Outbound: Not redirecting")}}
26
- else if(a=="external"){window.onbeforeunload=function(e){if(!l){if(!navigator.sendBeacon){__gaTracker("send","event","outbound-link",t,n.title,{"hitCallback":r})}
27
- else{__gaTracker("send","event","outbound-link",t,n.title,{transport:"beacon"})};setTimeout(r,1000)}
28
- else{console.log("Not Target | External | Send | 'outbound-link' | "+t+" | "+n.title);console.log("External: Redirecting")}};if(l){console.log("External: Not redirecting")}}
29
- else{if(l){console.log("Not Target | "+a+" | "+t+" is not a tracked click.")}};if(!l&&(a!="external"&&a!="internal-as-outbound")){setTimeout(r,1000)}
30
- else{if(a!="external"&&a!="internal-as-outbound"){window.location.href=t}}}}}
31
- else{if(l){console.log("Will track: false")}}};var e=window,n="click";e.addEventListener?e.addEventListener("load",function(){document.body.addEventListener(n,t,!1)},!1):e.attachEvent&&e.attachEvent("onload",function(){document.body.attachEvent("on"+n,t)})})();
1
+ ;var MonsterInsights=function(){var t="";this.setLastClicked=function(e){t=e};this.getLastClicked=function(){return t};function r(){var n=!1;if(monsterinsights_frontend.is_debug_mode==="true"){n=!0};var e=[],t=[];if(typeof monsterinsights_frontend.download_extensions=="string"){t=monsterinsights_frontend.download_extensions.split(",")};if(typeof monsterinsights_frontend.inbound_paths=="string"){e=monsterinsights_frontend.inbound_paths.split(",")};var a={"is_debug_mode":n,"download_extensions":t,"inbound_paths":e,"home_url":monsterinsights_frontend.home_url,"track_download_as":monsterinsights_frontend.track_download_as,"internal_label":"outbound-link-"+monsterinsights_frontend.internal_label,};return a};function e(e){var t=r(),n=t.is_debug_mode||window.monsterinsights_debug_mode;if(n){console.log(e)}};function i(n){var f=r(),a=n.srcElement||n.target;e("__gaTracker.hasOwnProperty(loaded)");e(__gaTracker.hasOwnProperty("loaded"));e("__gaTracker.loaded");e(__gaTracker.loaded);e("Event.which: "+n.which);e("El: ");e(a);e("GA Loaded and click: "+!(!__gaTracker.hasOwnProperty("loaded")||__gaTracker.loaded!=!0||(n.which!=1&&n.which!=2&&!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&!n.altKey)));if(!__gaTracker.hasOwnProperty("loaded")||__gaTracker.loaded!=!0||(n.which!=1&&n.which!=2&&!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&!n.altKey)){e("Will track: false");t="ganlonte";return}
2
+ while(a&&(typeof a.tagName=="undefined"||a.tagName.toLowerCase()!="a"||!a.href)){a=a.parentNode};if(a&&a.href){var i=a.href,l=a.href,o="internal",v=f.download_extensions,h=f.inbound_paths,y=f.home_url,b=f.track_download_as,u=f.internal_label;e("Will track: true");l=l.substring(0,(l.indexOf("#")==-1)?l.length:l.indexOf("#"));l=l.substring(0,(l.indexOf("?")==-1)?l.length:l.indexOf("?"));l=l.substring(l.lastIndexOf("/")+1,l.length);l=l.substring(l.indexOf(".")+1);var c=(function(){var n=0,e=document.domain,a=e.split("."),t="_gd"+(new Date()).getTime();while(n<(a.length-1)&&document.cookie.indexOf(t+"="+t)==-1){e=a.slice(-1-(++n)).join(".");document.cookie=t+"="+t+";domain="+e+";"};document.cookie=t+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain="+e+";";return e})();if(typeof String.prototype.endsWith!=="function"){String.prototype.endsWith=function(e){return this.indexOf(e,this.length-e.length)!==-1}};if(typeof String.prototype.startsWith!=="function"){String.prototype.startsWith=function(e){return this.indexOf(e)===0}};if(typeof Array.prototype.includes!=="function"){Object.defineProperty(Array.prototype,"includes",{value:function(e,i){if(this==null){throw new TypeError("\"this\" is null or not defined")};var r=Object(this),a=r.length>>>0;if(a===0){return!1};var t=i|0,n=Math.max(t>=0?t:a-Math.abs(t),0);while(n<a){if(r[n]===e){return!0};n++};return!1}})};if(typeof Array.prototype.lastIndexOf!=="function"){Array.prototype.lastIndexOf=function(t){"use strict";if(this===void 0||this===null){throw new TypeError()};var e,n,r=Object(this),a=r.length>>>0;if(a===0){return-1};e=a-1;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}
3
+ else if(e!=0&&e!=(1/0)&&e!=-(1/0)){e=(e>0||-1)*Math.floor(Math.abs(e))}};for(n=e>=0?Math.min(e,a-1):a-Math.abs(e);n>=0;n--){if(n in r&&r[n]===t){return n}};return-1}};function k(e){return e.replace(/^\s+|\s+$/gm,"")};e("Link: "+i);e("Extension: "+l);e("Protocol: "+a.protocol);e("External: "+(a.hostname.length>0&&c.length>0&&!a.hostname.endsWith(c)));e("Current domain: "+c);e("Link domain: "+a.hostname);e("Outbound Paths: "+h);if(k(a.protocol)=="mailto"||k(a.protocol)=="mailto:"){o="mailto"}
4
+ else if(v.length>0&&l.length>0&&v.includes(l)){o="download"}
5
+ else if(a.hostname.length>0&&c.length>0&&!a.hostname.endsWith(c)){o="external"}
6
+ else{var d,p,w=a.pathname;for(d=0,p=h.length;d<p;++d){if(h[d].length>0&&w.startsWith(h[d])){o="internal-as-outbound";break}}};t=o;e("Type: "+o);if(o!=="internal"&&!i.match(/^javascript\:/i)){var g=(a.target&&!a.target.match(/^_(self|parent|top)$/i))?a.target:!1;if(n.ctrlKey||n.shiftKey||n.metaKey||n.which==2){g="_blank"};e("Control Key: "+n.ctrlKey);e("Shift Key: "+n.shiftKey);e("Meta Key: "+n.metaKey);e("Which Key: "+n.which);e("Target: "+g);var m=!1,s=function(){if(m){return};m=!0;window.location.href=i};if(g){if(o=="download"){if(b=="pageview"){__gaTracker("send","pageview",i);e("Target | Download | Send | Pageview | "+i)}
7
+ else{__gaTracker("send","event","download",i);e("Target | Download | Send | Event | "+i)}}
8
+ else if(o=="mailto"){__gaTracker("send","event","mailto",i);e("Target | Mailto | Send | Event | Mailto | "+i)}
9
+ else if(o=="internal-as-outbound"){__gaTracker("send","event",u,i,a.title);e("Target | Internal-As-Outbound | Send | event | "+u+" | "+i+" | "+a.title)}
10
+ else if(o=="external"){__gaTracker("send","event","outbound-link",i,a.title);e("Target | External | Send | 'outbound-link' | "+i+" | "+a.title)}
11
+ else{e("Target | "+o+" | "+i+" is not a tracked click.")}}
12
+ else{if(o!="external"&&o!="internal-as-outbound"){if(!n.defaultPrevented){n.preventDefault?n.preventDefault():n.returnValue=!1}};if(o=="download"){if(b=="pageview"){__gaTracker("send","pageview",i,{"hitCallback":s});e("Not Target | Download | Send | Pageview | "+i)}
13
+ else{__gaTracker("send","event","download",{"hitCallback":s});e("Not Target | Download | Send | Event | "+i)}}
14
+ else if(o=="mailto"){__gaTracker("send","event","mailto",i,{"hitCallback":s});e("Not Target | Mailto | Send | Event | Mailto | "+i)}
15
+ else if(o=="internal-as-outbound"){window.onbeforeunload=function(t){if(!n.defaultPrevented){n.preventDefault?n.preventDefault():n.returnValue=!1};if(!navigator.sendBeacon){__gaTracker("send","event",u,i,a.title,{"hitCallback":s})}
16
+ else{__gaTracker("send","event",u,i,a.title,{transport:"beacon","hitCallback":s})};setTimeout(s,1000);e("Not Target | Internal-As-Outbound | Send | event | "+u+" | "+i+" | "+a.title);e("Internal as Outbound: Redirecting")};t=o;e("Internal as Outbound: Not redirecting")}
17
+ else if(o=="external"){window.onbeforeunload=function(t){if(!navigator.sendBeacon){__gaTracker("send","event","outbound-link",i,a.title,{"hitCallback":s})}
18
+ else{__gaTracker("send","event","outbound-link",i,a.title,{transport:"beacon","hitCallback":s})};setTimeout(s,1000);e("Not Target | External | Send | 'outbound-link' | "+i+" | "+a.title);e("External: Redirecting")};t=o;e("External: Not redirecting")}
19
+ else{e("Not Target | "+o+" | "+i+" is not a tracked click.")};if(o!="external"&&o!="internal-as-outbound"){setTimeout(s,1000)}}}}
20
+ else{t="internal";e("Will track: false")}};var n=window,a="click";n.addEventListener?n.addEventListener("load",function(){document.body.addEventListener(a,i,!1)},!1):n.attachEvent&&n.attachEvent("onload",function(){document.body.attachEvent("on"+a,i)})},MonsterInsightsObject=new MonsterInsights();
 
 
 
 
 
 
 
 
 
 
 
googleanalytics.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
- * Version: 6.0.15
10
  * Requires at least: 3.9.0
11
  * Tested up to: 4.7.4
12
  *
@@ -69,7 +69,7 @@ final class MonsterInsights_Lite {
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
- public $version = '6.0.15';
73
 
74
  /**
75
  * Plugin file.
6
  * Author: MonsterInsights
7
  * Author URI: https://www.monsterinsights.com/
8
  *
9
+ * Version: 6.0.16
10
  * Requires at least: 3.9.0
11
  * Tested up to: 4.7.4
12
  *
69
  * @access public
70
  * @var string $version Plugin version.
71
  */
72
+ public $version = '6.0.16';
73
 
74
  /**
75
  * Plugin file.
includes/frontend/tracking/class-tracking-disabled.php CHANGED
@@ -87,7 +87,7 @@ class MonsterInsights_Tracking_Disabled extends MonsterInsights_Tracking_Abstrac
87
  $output = PHP_EOL . '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->' . PHP_EOL;
88
 
89
  if ( current_user_can( 'monsterinsights_save_settings' ) ) {
90
- $output .= '<!-- ' . sprintf( esc_html__( '@Webmaster, normally you will find the Google Analytics tracking code here, but you are in the disabled user groups. To change this, navigate to Insights %1$s Settings %2$s Ignore Users', 'google-analytics-for-wordpress' ), '->' ) . ' -->' . PHP_EOL;
91
  } else {
92
  $output .= '<!-- ' . esc_html__( 'Normally you will find the Google Analytics tracking code here, but the webmaster disabled your user group.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL;
93
  }
87
  $output = PHP_EOL . '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->' . PHP_EOL;
88
 
89
  if ( current_user_can( 'monsterinsights_save_settings' ) ) {
90
+ $output .= '<!-- ' . sprintf( esc_html__( '@Webmaster, normally you will find the Google Analytics tracking code here, but you are in the disabled user groups. To change this, navigate to Insights %1$s Settings %1$s Ignore Users', 'google-analytics-for-wordpress' ), '->' ) . ' -->' . PHP_EOL;
91
  } else {
92
  $output .= '<!-- ' . esc_html__( 'Normally you will find the Google Analytics tracking code here, but the webmaster disabled your user group.', 'google-analytics-for-wordpress' ) . ' -->' . PHP_EOL;
93
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.9
6
  Tested up to: 4.7.4
7
- Stable tag: 6.0.15
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
@@ -137,6 +137,9 @@ You can also learn about other <a href="http://www.wpbeginner.com/category/plugi
137
 
138
  == Changelog ==
139
 
 
 
 
140
  = 6.0.15, March 7, 2017 =
141
  * Fixed: Issue with translation string numbering in the disabled user group frontend template.
142
  * Fixed: Resolved issue that caused issue with lightbox-style redirects.
4
  Tags: analytics, analytics dashboard, google analytics, google analytics dashboard, google analytics widget, universal google analytics, statistics, tracking, stats, google, yoast, google analytics by yoast, ga, monster insights, monsterinsights, universal analytics, web stats, ecommerce, ecommerce tracking
5
  Requires at least: 3.9
6
  Tested up to: 4.7.4
7
+ Stable tag: 6.0.16
8
  License: GPL v3
9
 
10
  The best Google Analytics plugin for WordPress. See how visitors find and use your website, so you can keep them coming back.
137
 
138
  == Changelog ==
139
 
140
+ = 6.0.16, March 7, 2017 =
141
+ * Fixed: Issues related to link tracking.
142
+
143
  = 6.0.15, March 7, 2017 =
144
  * Fixed: Issue with translation string numbering in the disabled user group frontend template.
145
  * Fixed: Resolved issue that caused issue with lightbox-style redirects.