ba-js-rt 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rt.js +1 -1
- package/package.json +1 -1
package/lib/rt.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var BA=window.BA||{};function e(e,n,o,t,c,a){var r,i=new Date;i.setTime(i.getTime()),o&&(r=864e5*o);var s=new Date(i.getTime()+r);document.cookie="".concat(e,"=").concat(escape(n)).concat(r?";expires=".concat(s.toGMTString()):"").concat(t?";path=".concat(t):"").concat(c?";domain=".concat(c):"").concat(a?";secure":"")}function n(e){for(var n=document.cookie.split(";"),o="",t="",c="",a=0;a<n.length;a+=1){if((o=n[a].split("="))[0].replace(/^\s+|\s+$/g,"")===e)return o.length>1&&(c=unescape(o[1].replace(/^\s+|\s+$/g,""))),c;o=null}return null}function o(){var e=BA.measurementIds,n=BA.gaId,o=BA.gaAnonymiseIp;return e?{accounts:{measurementIds:e}}:n?{accounts:{hotel:{name:"hotel",trackingId:n,anonymizeIp:o}}}:void 0}!function(){var n,o,t,c=(n="",top.location&&(n=top.location.href),o="unset",(t=n.match(/[&?]r=([^&]*)/))&&t.length>1&&(o=escape(t[1])),o);if(c&&"null"!==c&&"unset"!==c&&""!==c){var a=function(){for(var e=0,n=document.domain,o=n.split("."),t="_gd".concat(new Date().getTime());e<o.length-1&&-1===document.cookie.indexOf("".concat(t,"=").concat(t));)e+=1,n=o.slice(-1-e).join("."),document.cookie="".concat(t,"=").concat(t,";domain=").concat(n,";");return document.cookie="".concat(t,"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=").concat(n,";"),n}(window.location.hostname);e("r",escape(c),0,"/",a),e("ra",escape(c),365,"/",a)}}();var t=new Promise(function(e,t){var c="https://unpkg.com/ba-js-tracker@
|
|
1
|
+
var BA=window.BA||{};function e(e,n,o,t,c,a){var r,i=new Date;i.setTime(i.getTime()),o&&(r=864e5*o);var s=new Date(i.getTime()+r);document.cookie="".concat(e,"=").concat(escape(n)).concat(r?";expires=".concat(s.toGMTString()):"").concat(t?";path=".concat(t):"").concat(c?";domain=".concat(c):"").concat(a?";secure":"")}function n(e){for(var n=document.cookie.split(";"),o="",t="",c="",a=0;a<n.length;a+=1){if((o=n[a].split("="))[0].replace(/^\s+|\s+$/g,"")===e)return o.length>1&&(c=unescape(o[1].replace(/^\s+|\s+$/g,""))),c;o=null}return null}function o(){var e=BA.measurementIds,n=BA.gaId,o=BA.gaAnonymiseIp;return e?{accounts:{measurementIds:e}}:n?{accounts:{hotel:{name:"hotel",trackingId:n,anonymizeIp:o}}}:void 0}!function(){var n,o,t,c=(n="",top.location&&(n=top.location.href),o="unset",(t=n.match(/[&?]r=([^&]*)/))&&t.length>1&&(o=escape(t[1])),o);if(c&&"null"!==c&&"unset"!==c&&""!==c){var a=function(){for(var e=0,n=document.domain,o=n.split("."),t="_gd".concat(new Date().getTime());e<o.length-1&&-1===document.cookie.indexOf("".concat(t,"=").concat(t));)e+=1,n=o.slice(-1-e).join("."),document.cookie="".concat(t,"=").concat(t,";domain=").concat(n,";");return document.cookie="".concat(t,"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=").concat(n,";"),n}(window.location.hostname);e("r",escape(c),0,"/",a),e("ra",escape(c),365,"/",a)}}();var t=new Promise(function(e,t){var c="https://unpkg.com/ba-js-tracker@4.0.1/dist/ba-js-tracker.umd.js",a=document.createElement("script");a.src=c,document.head.appendChild(a),a.addEventListener("load",function(){var t={},c=o();if(c){var a=BA.gaConsent,r=BA.gaWaitForConsent,i=BA.gdpr,s=BA.showBanner;("no"===i||"no"===s||!("boolean"!=typeof r||r)||+n("cookie-consent")&a)&&(t={GoogleAnalytics:c})}var d=window.baJsTracker.default({trackers:t}),u=BA.hotel_id,l=BA.hotelId,g=BA.guide_id,f=BA.guideId,m=BA.hotel_group_id,p=BA.userLanguage,h=function e(n){return Object.keys(n).forEach(function(o){var t,c=n[o],a=void 0===c?"undefined":c&&"undefined"!=typeof Symbol&&c.constructor===Symbol?"symbol":typeof c;"object"===a?(e(c),Object.keys(c).length||delete n[o]):"undefined"===a&&delete n[o]}),n}({context:{hotel:{hotelId:u||l,guideId:g||f,cgGroupId:m,cookiePolicyUrl:BA.cookiePolicyUrl},userLanguage:p,client:"CookieBanner"}});return d.event=d.event.bind(null,h),e(d)}),a.addEventListener("error",function(){t(Error("".concat(c," failed to load.")))})});t.then(function(e){var t=o();if(t&&!e.getTrackers().find(function(e){return"GoogleAnalytics"===e}))var c=setInterval(function(){+n("cookie-consent")&BA.gaConsent&&(clearInterval(c),e.addTrackers({GoogleAnalytics:t}),e.event({event:{type:"pageView",whitelist:["GoogleAnalytics"]}}).catch(function(e){console.error(e)}))},250)}).catch(function(e){console.error(e)}),BA.baJsTracker=t;
|