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 | 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 +98 -124
- assets/js/frontend.min.js +20 -31
- googleanalytics.php +2 -2
- includes/frontend/tracking/class-tracking-disabled.php +1 -1
- readme.txt +4 -1
assets/js/frontend.js
CHANGED
@@ -10,11 +10,19 @@
|
|
10 |
*
|
11 |
* @since 6.0.12
|
12 |
*/
|
13 |
-
|
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
|
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(
|
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 |
-
|
63 |
-
|
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 |
-
|
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 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
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 |
-
|
246 |
-
|
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 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
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 |
-
|
284 |
-
|
285 |
-
} else {
|
286 |
-
console.log( "Target | Download | Send | Pageview | " + link );
|
287 |
-
}
|
288 |
} else {
|
289 |
-
|
290 |
-
|
291 |
-
} else {
|
292 |
-
console.log( "Target | Download | Send | Event | " + link );
|
293 |
-
}
|
294 |
}
|
295 |
} else if ( type == 'mailto' ) {
|
296 |
-
|
297 |
-
|
298 |
-
} else {
|
299 |
-
console.log( "Target | Mailto | Send | Event | Mailto | " + link );
|
300 |
-
}
|
301 |
-
|
302 |
} else if ( type == 'internal-as-outbound' ) {
|
303 |
-
|
304 |
-
|
305 |
-
} else {
|
306 |
-
console.log( "Target | Internal-As-Outbound | Send | event | " + internal_label + " | " + link + " | " + el.title );
|
307 |
-
}
|
308 |
-
|
309 |
} else if ( type == 'external' ) {
|
310 |
-
|
311 |
-
|
312 |
-
} else {
|
313 |
-
console.log( "Target | External | Send | 'outbound-link' | " + link + " | " + el.title );
|
314 |
-
}
|
315 |
-
|
316 |
} else {
|
317 |
-
|
318 |
-
console.log( "Target | " + type + " | " + link + " is not a tracked click." );
|
319 |
-
}
|
320 |
}
|
321 |
-
} else {
|
|
|
|
|
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 |
-
|
329 |
-
|
330 |
-
} else {
|
331 |
-
console.log( "Not Target | Download | Send | Pageview | " + link );
|
332 |
-
}
|
333 |
} else {
|
334 |
-
|
335 |
-
|
336 |
-
} else {
|
337 |
-
console.log( "Not Target | Download | Send | Event | " + link );
|
338 |
-
}
|
339 |
}
|
340 |
-
|
341 |
} else if ( type == 'mailto' ) {
|
342 |
-
|
343 |
-
|
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 (
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
}
|
356 |
-
setTimeout( __gaTrackerHitBack, 1000 );
|
357 |
} else {
|
358 |
-
|
359 |
-
console.log( "Internal as Outbound: Not redirecting" );
|
360 |
}
|
|
|
|
|
|
|
|
|
|
|
361 |
};
|
362 |
-
|
363 |
-
|
364 |
-
}
|
365 |
} else if ( type == 'external' ) {
|
366 |
window.onbeforeunload = function(e) {
|
367 |
-
if ( !
|
368 |
-
|
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 |
-
|
376 |
-
console.log( "External: Redirecting" );
|
377 |
}
|
|
|
|
|
|
|
|
|
|
|
378 |
};
|
379 |
-
|
380 |
-
|
381 |
-
}
|
382 |
} else {
|
383 |
-
|
384 |
-
console.log( "Not Target | " + type + " | " + link + " is not a tracked click." );
|
385 |
-
}
|
386 |
}
|
387 |
|
388 |
-
if (
|
389 |
-
|
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 |
-
|
400 |
-
|
401 |
-
}
|
402 |
}
|
403 |
}
|
404 |
|
405 |
-
var __gaTrackerWindow
|
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
|
2 |
-
while(
|
3 |
-
else if(e!=0&&e!=(1/0)&&e!=-(1/0)){e=(e>0||-1)*Math.floor(Math.abs(e))}};for(
|
4 |
-
else if(
|
5 |
-
else if(
|
6 |
-
else{var
|
7 |
-
else{
|
8 |
-
else
|
9 |
-
else{
|
10 |
-
else if(
|
11 |
-
else{
|
12 |
-
else
|
13 |
-
else{
|
14 |
-
else if(
|
15 |
-
else
|
16 |
-
else{
|
17 |
-
else
|
18 |
-
else{
|
19 |
-
else{
|
20 |
-
else{
|
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.
|
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.
|
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 %
|
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.
|
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.
|