From 5f8650ef45f7654840cf77746eee7449a073b9e3 Mon Sep 17 00:00:00 2001 From: "Alyssa.Yu" Date: Wed, 2 Oct 2024 23:24:53 -0700 Subject: [PATCH] fix: test --- .gitignore | 2 +- dist/index.js | 1 + dist/index.js.br | Bin 0 -> 9188 bytes src/amplitude-wrapper.js | 24 ++++++++++++++++++------ 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 dist/index.js create mode 100644 dist/index.js.br diff --git a/.gitignore b/.gitignore index 3fdedb4..39d3c96 100644 --- a/.gitignore +++ b/.gitignore @@ -99,7 +99,7 @@ typings/ # Nuxt.js build / generate output .nuxt -dist + .DS_Store .idea diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..4b97457 --- /dev/null +++ b/dist/index.js @@ -0,0 +1 @@ +(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),((e,i,t)=>{!function(e,i){var t=e.amplitudeGTM||{_q:[],_iq:{}};if(t.invoked)e.console&&console.error&&console.error("Amplitude snippet has been loaded.");else{var n=function(e,i){e.prototype[i]=function(){return this._q.push({name:i,args:Array.prototype.slice.call(arguments,0)}),this}},r=function(e,i,t){return function(n){e._q.push({name:i,args:Array.prototype.slice.call(t,0),resolve:n})}},o=function(e,i,t){e._q.push({name:i,args:Array.prototype.slice.call(t,0)})},a=function(e,i,t){e[i]=function(){if(t)return{promise:new Promise(r(e,i,Array.prototype.slice.call(arguments)))};o(e,i,Array.prototype.slice.call(arguments))}},s=function(e){for(var i=0;i0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):n:this[u[0]]=c?u[1].call(this,c,u[2]):n:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):n):this[u]=c||n;d+=2}},F=function(e,i){for(var t in i)if(typeof i[t]===a&&i[t].length>0){for(var r=0;r350?B(e,350):e,this},this.setUA(r),this};Z.VERSION="0.7.33",Z.BROWSER=C([l,p,"major"]),Z.CPU=C([b]),Z.DEVICE=C([u,d,c,w,f,g,m,v,h]),Z.ENGINE=Z.OS=C([l,p]),e.exports&&(i=e.exports=Z),i.UAParser=Z;var $=typeof t!==o&&(t.jQuery||t.Zepto);if($&&!$.ua){var Q=new Z;$.ua=Q.getResult(),$.ua.get=function(){return Q.getUA()},$.ua.set=function(e){Q.setUA(e);var i=Q.getResult();for(var t in i)$.ua[t]=i[t]}}}("object"==typeof window?window:o)}(a,a.exports);var s=a.exports,u=function(e){var t=this;void 0===e&&(e={});var o,a=e.osName,u=void 0===a||a,l=e.osVersion,c=void 0===l||l,d=e.deviceManufacturer,p=void 0===d||d,b=e.deviceModel,w=void 0===b||b;return{name:"@amplitude/plugin-user-agent-enrichment-browser",type:"enrichment",setup:function(e){return n(this,void 0,void 0,(function(){var i;return r(this,(function(t){return"undefined"!=typeof navigator&&(i=navigator.userAgent),o=new s(i).getResult(),e.loggerProvider.log("Installing @amplitude/plugin-user-agent-enrichment-browser."),[2]}))}))},execute:function(e){return n(t,void 0,void 0,(function(){var t,n,a,s;return r(this,(function(r){return t=o.browser.name,n=o.browser.version,a=o.device.model||o.os.name,s=o.device.vendor,[2,i(i(i(i(i({},e),u&&{os_name:t}),c&&{os_version:n}),p&&{device_manufacturer:s}),w&&{device_model:a})]}))}))}}};return e.plugin=u,e.userAgentEnrichmentPlugin=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({});!function(e,i){const t=e.amplitudeGTM;if(t&&"function"==typeof t.init){var o=["init","track","identify","setGroup","groupIdentify","revenue","flush","getUserId","setUserId","getSessionId","setSessionId","setDeviceId","getDeviceId","reset","setOptOut","setTransport"],a=["add","append","clearAll","prepend","set","setOnce","remove","preInsert","postInsert"],s=function(e,i,n){if(i=i.shift(),Array.isArray(i)&&0!==i.length){var r=new t.Identify;if(i.forEach((function(e){if(Array.isArray(e)){var i=e.shift();-1!==a.indexOf(i)&&r[i].apply(r,e)}})),!0===n)return r;e.identify(r)}},u=function(e,i){if(!(i.length<3)&&"string"==typeof i[0]&&"string"==typeof i[1]&&Array.isArray(i[2])&&0!==i[2].length){var t=s(e,[i[2]],!0);e.groupIdentify(i[0],i[1],t)}},l=function(e,i){if((i=i.shift()).price&&i.productId){var n=(new t.Revenue).setProductId(i.productId).setQuantity(i.quantity||1).setPrice(i.price).setRevenueType(i.revenueType||"").setEventProperties(i.eventProperties||{}).setRevenue(i.revenue||i.price*(i.quantity||1));e.revenue(n)}},c=function(e){return e?.reduce(((e,i)=>(null!==function(e){try{return new RegExp(e)}catch(e){return console.error(`[Amplitude / GTM] - ${e}`),null}}(i)&&e.push(i),e)),[])},d=function(e,i){const t=i[i.length-1];if(t.autocapture.attribution){const e=[...t.autocapture.attribution.excludeReferrersText||[],...c(t.autocapture.attribution.excludeReferrersRegex)||[]];console.log("excludeReferrers in gtm wrapper",e),delete t.autocapture.attribution.excludeReferrersText,delete t.autocapture.attribution.excludeReferrersRegex,0!==e.length&&(t.autocapture.attribution.excludeReferrers=e)}if(t.autocapture.elementInteractions){const e=[...t.autocapture.elementInteractions.pageUrlAllowlistString||[],...c(t.autocapture.elementInteractions.pageUrlAllowlistRegex)||[]];delete t.autocapture.elementInteractions.pageUrlAllowlistString,delete t.autocapture.elementInteractions.pageUrlAllowlistRegex,0!==e.length&&(t.autocapture.elementInteractions.pageUrlAllowlist=e);const i=[...t.autocapture.elementInteractions.dataAttributePrefixString||[],...c(t.autocapture.elementInteractions.dataAttributePrefixRegex)||[]];delete t.autocapture.elementInteractions.dataAttributePrefixString,delete t.autocapture.elementInteractions.dataAttributePrefixRegex,0!==i.length&&(t.autocapture.elementInteractions.dataAttributePrefix=i)}const o=t.userAgentEnrichmentOptions,a=t.pageViewLegacy;o&&e.add(r.userAgentEnrichmentPlugin(o)),a&&e.add(n.pageViewV1EnrichmentPlugin());let s=e.init(...i).promise;return s.then((()=>e.add({name:"gtm-library-enrichment",type:"enrichment",setup:async()=>{},execute:async e=>(e.library="amplitude-ts-gtm/3.11.0",e)}))),s};e[i]=e[i]||function(){var e=[].slice.call(arguments,0),i=e.shift(),n=i?t._iq[i]:t;n||(n=t.createInstance(i));var r=e.shift();if(-1!==o.indexOf(r))return"revenue"===r?l(n,e):"identify"===r?s(n,e):"groupIdentify"===r?u(n,e):"init"===r?d(n,e):n[r].apply(this,e)}}}(window,"_amplitude")})(0,0,e)})(); \ No newline at end of file diff --git a/dist/index.js.br b/dist/index.js.br new file mode 100644 index 0000000000000000000000000000000000000000..4cbbb2786adeb061d406c32c4a976e5629763763 GIT binary patch literal 9188 zcmVvljPjnFDvVcf9Pg3o1UDWFe7?bH@iD*WqDKdO% z`sL}mQDE&naHA8cGEWD(0Z)t?$FH{OLS;X7pFqO_<)2K6iLUa6nOd^q+cf*CWwwe6 z*z;eM#C`iJv|1(unIgGxLQ+ZV;juzlO=$l674s$3&9AyXAn*Rb%B;s<~h@sKv5TBD5@(O^SP)l<*xTTwKY7nEqH=% zNoZet?IEV&>oonh*p>hRLg=xa_BIF^E?<1Y1WB=VyyU8XFF^b5LB$Pc{2Hhc)epyE zhMtZcYlo;v7ogHMrEH22f(K)iEX`*Be*Tupl*6-z0(^YJ{!?VxrqDHWY^3r0rC z7Kms|-(waH076JgVsnCFGl}-MF2-u_hn^(1_^f@C(zLy7)rKuSm(wvjU4T@2IQZY# z>hr3ni7Z=*EV<~nDGTZW*vCHO2O0*HS)VxRS$?T>R~;mzgEMiHSVh)TQLtHM%hYmv zStNsyPbvxf(s4OFO#y*-Gy?uK98%;Zi(Dz--0+wL{F4YCxyy7!)fC~PkPBOuD_v^r z&tEB^?>LoMc)r{M*>R1qCW~X1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-_n-{K@3A7FhZBpO7Acs0um_C28_9u$TRG|GAvy z4#(v6R$YJhFuuUnJo5;wh=Z!bDHU=yDj)2M)E2bJ*x(JiAa`yU+0n7*z=a=LbZv{~ z=knbrd4`jPGvXC{J<=wW3Ax4j@?e+XI>9fr4$ z2yok?xw8KGJuTH@Z4oBd4PIIM(v}*R`ElLoht(fZ4Lt&jZ=c%bN<|)BD2GKRc1;5; zXjB4q$<=>irvvgat?@PPhFnOst;Q53HCt-^u794&HWY)-H(LUEOj-LH36N&{!ddcv zWHSqEUmNV@ep!~1uYL9A_5DOCHQESZ@mGxW*yu)O{O_6ZE1qC zL)*`DKw7f-B7_D!XFTAat%8>Y!Awv!aHj<{W)612M`{uULyBQ{Bb^lxw--P>6D9># zr%wQtDKWQ?b&f?C!#PWB26v!EY^f*b5c@-at#u3NgseC>PBRaufx<64rsgWHu&SF< zF&CuThXCl_jYY z9IeY=Gbt4T0gDUNHMCV2y|Aw?*f=RQsQsb6hR-?6(>lakB6u>N?P}~x@ZzW5^wPP1@fT_sMAjkTz*GI=|`+5dfY^r { + var regExp = getRegExp(item); + if (regExp !== null) { + acc.push(item); + } + return acc; + }, []); + }; + var init = function(client, args) { const argsLength = args.length; @@ -169,8 +180,9 @@ const LOG_PREFIX = '[Amplitude / GTM]'; if (configuration.autocapture.attribution) { const excludeReferrers = [ ...(configuration.autocapture.attribution.excludeReferrersText || []), - ...(configuration.autocapture.attribution.excludeReferrersRegex?.map(item => getRegExp(item)) || []) + ...(getValidExp(configuration.autocapture.attribution.excludeReferrersRegex) || []) ]; + console.log("excludeReferrers in gtm wrapper", excludeReferrers); delete configuration.autocapture.attribution.excludeReferrersText; delete configuration.autocapture.attribution.excludeReferrersRegex; // if excludeReferrers is empty, use default @@ -182,7 +194,7 @@ const LOG_PREFIX = '[Amplitude / GTM]'; if (configuration.autocapture.elementInteractions) { const pageUrlAllowlist = [ ...(configuration.autocapture.elementInteractions.pageUrlAllowlistString || []), - ...(configuration.autocapture.elementInteractions.pageUrlAllowlistRegex?.map(item => getRegExp(item)) || []) + ...(getValidExp(configuration.autocapture.elementInteractions.pageUrlAllowlistRegex) || []) ]; delete configuration.autocapture.elementInteractions.pageUrlAllowlistString; delete configuration.autocapture.elementInteractions.pageUrlAllowlistRegex; @@ -194,7 +206,7 @@ const LOG_PREFIX = '[Amplitude / GTM]'; const dataAttributePrefix = [ ...(configuration.autocapture.elementInteractions.dataAttributePrefixString || []), - ...(configuration.autocapture.elementInteractions.dataAttributePrefixRegex?.map(item => getRegExp(item)) || []) + ...(getValidExp(configuration.autocapture.elementInteractions.dataAttributePrefixRegex) || []) ] delete configuration.autocapture.elementInteractions.dataAttributePrefixString; delete configuration.autocapture.elementInteractions.dataAttributePrefixRegex;