web-manager 3.1.46 → 3.1.47

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.
Files changed (2) hide show
  1. package/index.js +22 -12
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -660,20 +660,30 @@ function Manager() {
660
660
  This.properties.meta.environment = utilities.get(configuration, 'global.settings.debug.environment', This.properties.meta.environment);
661
661
  This.properties.page.queryString = new URLSearchParams(window.location.search);
662
662
 
663
- var pageQueryString = This.properties.page.queryString
664
663
  var pagePathname = window.location.pathname;
665
- var qsAff = pageQueryString.get('aff');
666
- if (qsAff) {
667
- // store.set('auth.affiliateCode', qsAff);
668
- store.set('affiliateCode', qsAff);
669
- }
670
- var qsRedirect = pageQueryString.get('redirect');
671
- if (qsRedirect && This.isValidRedirectUrl(qsRedirect)) {
672
- window.location.href = decodeURIComponent(qsRedirect);
673
- return;
664
+ var redirect = false;
665
+
666
+ This.properties.page.queryString.forEach(function(value, key) {
667
+ if (key.startsWith('utm_')) {
668
+ store.set('utm.tags.' + key, value);
669
+ store.set('utm.timestamp', new Date().toISOString());
670
+ }
671
+
672
+ if (key === 'aff') {
673
+ store.set('affiliateCode', value);
674
+ }
675
+
676
+ if (key === 'redirect') {
677
+ // redirect = decodeURIComponent(value) // 9/22/23 - Removed this and replace without the decode
678
+ redirect = value;
679
+ }
680
+ })
681
+
682
+ if (redirect && This.isValidRedirectUrl(redirect)) {
683
+ return window.location.href = redirect;
674
684
  }
675
- var authRegex = /\/(signin|signup|forgot)\//;
676
- if (pagePathname.match(authRegex)) {
685
+
686
+ if (pagePathname.match(/\/(signin|signup|forgot)\//)) {
677
687
  import('./helpers/auth-pages.js')
678
688
  .then(function(mod) {
679
689
  mod.default()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.46",
3
+ "version": "3.1.47",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -36,4 +36,4 @@
36
36
  "firebase": "^9.23.0",
37
37
  "lazysizes": "^5.3.2"
38
38
  }
39
- }
39
+ }