diff --git a/README.md b/README.md index 91c112c..c7a8137 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,9 @@ client-side tier of your websites and web apps. Available on the [jsdelivr](https://www.jsdelivr.com/package/gh/snowplow/sp-js-assets) and [cdnjs](https://cdnjs.com/libraries/snowplow) The latest version is available here: -`https://cdn.jsdelivr.net/gh/snowplow/sp-js-assets@2.17.1/sp.js` +`https://cdn.jsdelivr.net/gh/snowplow/sp-js-assets@2.17.2/sp.js` and -`https://cdnjs.cloudflare.com/ajax/libs/snowplow/2.17.1/sp.js` +`https://cdnjs.cloudflare.com/ajax/libs/snowplow/2.17.2/sp.js` | Technical Docs | Setup Guide | |-------------------------------------|------------------------------| diff --git a/sp.js b/sp.js index 65ebd36..3d7d1f6 100644 --- a/sp.js +++ b/sp.js @@ -1,6 +1,6 @@ /** * @description JavaScript tracker for Snowplow - * @version 2.17.1 + * @version 2.17.2 * @copyright Anthon Pang, Snowplow Analytics Ltd * @license Simplified BSD * @@ -81,8 +81,8 @@ data:a}})}function va(){return ea(E(),function(a){return{schema:"iglu:com.optimi data:b}}}function fa(){!Db&&S.geolocation&&S.geolocation.getCurrentPosition&&(Db=!0,S.geolocation.getCurrentPosition(function(a){var b=a.coords;jb.push({schema:"iglu:com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0",data:{latitude:b.latitude,longitude:b.longitude,latitudeLongitudeAccuracy:b.accuracy,altitude:b.altitude,altitudeAccuracy:b.altitudeAccuracy,bearing:b.heading,speed:b.speed,timestamp:Math.round(a.timestamp)}})}))}function Ba(){var a={};Q("__utma __utmb __utmc __utmv __utmz _ga".split(" "), function(b){var c=K(b);c&&(a[b]=c)});return{schema:"iglu:com.google.analytics/cookies/jsonschema/1-0-0",data:a}}function Ga(a,b,c,d,e){h();Fb&&X();Fb=!0;wb=z.title;Ob=a;a=oc(Ob||wb);t.trackPageView(p(xb||Ca),a,p(ca||Mb),x((b||[]).concat(c?c():[])),d,e);d=new Date;e=!1;if(Y.enabled&&!Y.installed){e=Y.installed=!0;var f={update:function(){if("undefined"!==typeof window&&"function"===typeof window.addEventListener){var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}}),c=function(){}; window.addEventListener("testPassiveEventSupport",c,b);window.removeEventListener("testPassiveEventSupport",c,b);f.hasSupport=a}}};f.update();a="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(f,"hasSupport")?q(z,a,r,{passive:!0}):q(z,a,r);B();a=function(a){var b=1(new Date).getTime()&&c(a.callback,b)};a.activityInterval=0!=a.configMinimumVisitLength? -setTimeout(function(){Ub+a.configMinimumVisitLength>(new Date).getTime()&&c(a.callback,b);a.activityInterval=setInterval(d,a.configHeartBeatTimer)},a.configMinimumVisitLength):setInterval(d,a.configHeartBeatTimer)}function xa(a,b,c){if("number"==typeof a&&a==dc(a)&&"number"==typeof b&&b==dc(b))return{configMinimumVisitLength:1E3*a,configHeartBeatTimer:1E3*b,activityInterval:null,callback:c};D("Activity tracking not enabled, please provide integer values for minimumVisitLength and heartBeatDelay."); +a(z));Q(["resize","focus","blur"],a(A));a(A,w)("scroll")}if(Y.enabled&&(ub||e)){Ub=d.getTime();for(var g in Y.configurations)Y.configurations.hasOwnProperty(g)&&(d=Y.configurations[g],clearInterval(d.activityInterval),Ka(d,b,c))}}function Ka(a,b,c){var d=function(a,b){h();a({context:b,pageViewId:U(),minXOffset:Vb,minYOffset:Xb,maxXOffset:Wb,maxYOffset:Yb});B()},e=function(){Ub+a.configHeartBeatTimer>(new Date).getTime()&&d(a.callback,(b||[]).concat(c?c():[]))};a.activityInterval=0!=a.configMinimumVisitLength? +setTimeout(function(){Ub+a.configMinimumVisitLength>(new Date).getTime()&&d(a.callback,(b||[]).concat(c?c():[]));a.activityInterval=setInterval(e,a.configHeartBeatTimer)},a.configMinimumVisitLength):setInterval(e,a.configHeartBeatTimer)}function xa(a,b,c){if("number"==typeof a&&a==dc(a)&&"number"==typeof b&&b==dc(b))return{configMinimumVisitLength:1E3*a,configHeartBeatTimer:1E3*b,activityInterval:null,callback:c};D("Activity tracking not enabled, please provide integer values for minimumVisitLength and heartBeatDelay."); return{}}function Na(a){var b=a.context,c=a.minXOffset,d=a.minYOffset,e=a.maxXOffset;a=a.maxYOffset;var f=z.title;f!==wb&&(wb=f,Ob=null);t.trackPagePing(p(xb||Ca),oc(Ob||wb),p(ca||Mb),P(c),P(e),P(d),P(a),x(b))}function ha(a,b){return""!==a?a+b.charAt(0).toUpperCase()+b.slice(1):b}function L(a){var b,c,d=["","webkit","ms","moz"];if(!kb)for(c=0;c1E3*La&&(T=R(),ja++), @@ -109,9 +109,9 @@ data:{id:a,affiliation:b,revenue:Jb(c),tax:Jb(d),shipping:Jb(e),coupon:f,list:g, data:{id:a,name:b,list:c,brand:d,category:e,variant:f,price:Jb(g),quantity:ob(h),coupon:k,position:ob(l),currency:p}})};l.addEnhancedEcommercePromoContext=function(a,b,c,d,e){Bb.push({schema:"iglu:com.google.analytics.enhanced-ecommerce/promoFieldObject/jsonschema/1-0-0",data:{id:a,name:b,creative:c,position:d,currency:e}})};l.enableGdprContext=function(a){var b=1