diff --git a/Gruntfile.js b/Gruntfile.js index 61f4b43..8b5aa18 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ module.exports = function(grunt) { ' * Created by the Google Analytics consultants at http://www.lunametrics.com/', ' * Written by @notdanwilkerson', ' * Documentation: https://github.com/lunametrics/gascroll/', - ' * Licensed under the Creative Commons 4.0 Attribution Public License', + ' * Licensed under the MIT License', ' */' ].join('\r\n'); diff --git a/luna-scroll-tracking.json b/luna-scroll-tracking.json index 37b9d2a..11bb32b 100644 --- a/luna-scroll-tracking.json +++ b/luna-scroll-tracking.json @@ -32,7 +32,7 @@ }, { "type": "TEMPLATE", "key": "html", - "value": "" + "value": "" }], "fingerprint": "0", "firingTriggerId": ["2147479553"], diff --git a/lunametrics-scroll-tracking.gtm.js b/lunametrics-scroll-tracking.gtm.js index 44f8b8f..949355d 100644 --- a/lunametrics-scroll-tracking.gtm.js +++ b/lunametrics-scroll-tracking.gtm.js @@ -511,9 +511,9 @@ 'label': document.location.pathname }); /* - * v1.1.0 + * v1.1.1 * Created by the Google Analytics consultants at http://www.lunametrics.com/ * Written by @notdanwilkerson * Documentation: https://github.com/lunametrics/gascroll/ - * Licensed under the Creative Commons 4.0 Attribution Public License + * Licensed under the MIT License */ \ No newline at end of file diff --git a/lunametrics-scroll-tracking.gtm.min.js b/lunametrics-scroll-tracking.gtm.min.js index bb8b961..2823afe 100644 --- a/lunametrics-scroll-tracking.gtm.min.js +++ b/lunametrics-scroll-tracking.gtm.min.js @@ -1,4 +1,4 @@ -!function(a,b,c){"use strict";function d(){return a.querySelector&&a.body.getBoundingClientRect?(c.dataLayerName=c.dataLayerName||"dataLayer",c.distances=c.distances||{},h(),void o(b,"scroll",n(h,500))):!1}function e(a,b){var d,e,h,i=s()||{},j=[],k=[];if(c.distances.percentages&&(c.distances.percentages.each&&(j=j.concat(c.distances.percentages.each)),c.distances.percentages.every))for(h=0;h=h&&(a[i]=h)}return a}function g(a,b){var c,d=parseInt(a,10),e=b/d,f=[];for(c=1;e+1>c;c++)f.push(c*d);return f}function h(){var a,b,d=j(c.bottom),f=j(c.top),g=m(d,f),h=e(g,f||0),l=k();for(b in h)a=h[b],l>a&&!r[b]&&(d||1/0)>a&&a>(f||0)&&(r[b]=!0,i(b))}function i(a){var d=b.GoogleAnalyticsObject;"undefined"==typeof b[c.dataLayerName]||c.forceSyntax?"function"==typeof b[d]&&"function"==typeof b[d].getAll&&2!==c.forceSyntax?b[d]("send","event",c.category,a,c.label,{nonInteraction:1}):"undefined"!=typeof b._gaq&&1!==c.forceSyntax&&b._gaq.push(["_trackEvent",c.category,a,c.label,0,!0]):b[c.dataLayerName].push({event:"scrollTracking",attributes:{distance:a,label:c.label}})}function j(b){if("number"==typeof b||parseInt(b,10))return parseInt(b,10);try{var c=1===b.nodeType?b:a.querySelector(b);return p(c)}catch(d){return void 0}}function k(){var c=void 0!==b.pageXOffset,d="CSS1Compat"===(a.compatMode||""),e=c?b.pageYOffset:d?a.documentElement.scrollTop:a.body.scrollTop;return parseInt(e,10)+parseInt(l(),10)}function l(){var b="CSS1Compat"===a.compatMode?a.documentElement:a.body;return b.clientHeight}function m(b,c){var d=a.body,e=a.documentElement,f=Math.max(d.scrollHeight,d.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);return c&&(f-=c),b&&(f=b-(c||0)),f-5}function n(a,b){var c,d,e,f=null,g=0,h=function(){g=new Date,f=null,e=a.apply(c,d)};return function(){var i=new Date;g||(g=i);var j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(f),f=null,g=i,e=a.apply(c,d)):f||(f=setTimeout(h,j)),e}}function o(a,b,c){a.addEventListener?a.addEventListener(b,c):a.attachEvent?a.attachEvent("on"+b,function(b){c.call(a,b)}):("undefined"==typeof a["on"+b]||null===a["on"+b])&&(a["on"+b]=function(b){c.call(a,b)})}function p(c){var d=c.getBoundingClientRect().top,e=void 0!==b.pageYOffset?b.pageYOffset:(a.documentElement||a.body.parentNode||a.body).scrollTop;return d+e}function q(a){return a instanceof Array}var r={};c.distances.percentages&&c.distances.percentages.every&&(q(c.distances.percentages.every)||(c.distances.percentages.every=[c.distances.percentages.every])),c.distances.pixels&&c.distances.pixels.every&&(q(c.distances.pixels.every)||(c.distances.pixels.every=[c.distances.pixels.every]));var s=function(b){function c(){var c,e,f,g,h,i;if(d={},b.each)for(i=0;i10&&(c(),e=0);for(a in d)b[a]=d[a];return b}}}(c.distances.elements);"loading"!==a.readyState?d():a.addEventListener?o(a,"DOMContentLoaded",d):o(b,"load",d)} +!function(a,b,c){"use strict";function d(){return!(!a.querySelector||!a.body.getBoundingClientRect)&&(c.dataLayerName=c.dataLayerName||"dataLayer",c.distances=c.distances||{},h(),void o(b,"scroll",n(h,500)))}function e(a,b){var d,e,h,i=s()||{},j=[],k=[];if(c.distances.percentages&&(c.distances.percentages.each&&(j=j.concat(c.distances.percentages.each)),c.distances.percentages.every))for(h=0;ha&&!r[b]&&a<(d||1/0)&&a>(f||0)&&(r[b]=!0,i(b))}function i(a){var d=b.GoogleAnalyticsObject;"undefined"==typeof b[c.dataLayerName]||c.forceSyntax?"function"==typeof b[d]&&"function"==typeof b[d].getAll&&2!==c.forceSyntax?b[d]("send","event",c.category,a,c.label,{nonInteraction:1}):"undefined"!=typeof b._gaq&&1!==c.forceSyntax&&b._gaq.push(["_trackEvent",c.category,a,c.label,0,!0]):b[c.dataLayerName].push({event:"scrollTracking",attributes:{distance:a,label:c.label}})}function j(b){if("number"==typeof b||parseInt(b,10))return parseInt(b,10);try{var c=1===b.nodeType?b:a.querySelector(b);return p(c)}catch(d){return}}function k(){var c=void 0!==b.pageXOffset,d="CSS1Compat"===(a.compatMode||""),e=c?b.pageYOffset:d?a.documentElement.scrollTop:a.body.scrollTop;return parseInt(e,10)+parseInt(l(),10)}function l(){var b="CSS1Compat"===a.compatMode?a.documentElement:a.body;return b.clientHeight}function m(b,c){var d=a.body,e=a.documentElement,f=Math.max(d.scrollHeight,d.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);return c&&(f-=c),b&&(f=b-(c||0)),f-5}function n(a,b){var c,d,e,f=null,g=0,h=function(){g=new Date,f=null,e=a.apply(c,d)};return function(){var i=new Date;g||(g=i);var j=b-(i-g);return c=this,d=arguments,j<=0?(clearTimeout(f),f=null,g=i,e=a.apply(c,d)):f||(f=setTimeout(h,j)),e}}function o(a,b,c){a.addEventListener?a.addEventListener(b,c):a.attachEvent?a.attachEvent("on"+b,function(b){c.call(a,b)}):"undefined"!=typeof a["on"+b]&&null!==a["on"+b]||(a["on"+b]=function(b){c.call(a,b)})}function p(c){var d=c.getBoundingClientRect().top,e=void 0!==b.pageYOffset?b.pageYOffset:(a.documentElement||a.body.parentNode||a.body).scrollTop;return d+e}function q(a){return a instanceof Array}var r={};c.distances.percentages&&c.distances.percentages.every&&(q(c.distances.percentages.every)||(c.distances.percentages.every=[c.distances.percentages.every])),c.distances.pixels&&c.distances.pixels.every&&(q(c.distances.pixels.every)||(c.distances.pixels.every=[c.distances.pixels.every]));var s=function(b){function c(){var c,e,f,g,h,i;if(d={},b.each)for(i=0;i10&&(c(),e=0);for(a in d)b[a]=d[a];return b}}}(c.distances.elements);"loading"!==a.readyState?d():a.addEventListener?o(a,"DOMContentLoaded",d):o(b,"load",d)} (document, window, { forceSyntax: false, dataLayerName: false, @@ -21,9 +21,9 @@ category: "Scroll Tracking", label: document.location.pathname });/* - * v1.1.0 + * v1.1.1 * Created by the Google Analytics consultants at http://www.lunametrics.com/ * Written by @notdanwilkerson * Documentation: https://github.com/lunametrics/gascroll/ - * Licensed under the Creative Commons 4.0 Attribution Public License + * Licensed under the MIT License */ \ No newline at end of file diff --git a/package.json b/package.json index 0166be7..82a4b03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scroll-tracking-google-analytics", - "version": "1.1.0", + "version": "1.1.1", "description": "Plug-and-play scroll tracking for Google Analytics with no dependencies.", "main": "Gruntfile.js", "scripts": {