@opexa/portal-sdk 0.59.136 → 0.59.138

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/dist/index.cjs CHANGED
@@ -11309,6 +11309,13 @@ var Sdk = class {
11309
11309
  const searchParams = new URLSearchParams(window.location.search);
11310
11310
  const hostname = window.location.hostname;
11311
11311
  const market = searchParams.get("market");
11312
+ const utmSource = searchParams.get("utm_source");
11313
+ const utmMedium = searchParams.get("utm_medium");
11314
+ const utmCampaign = searchParams.get("utm_campaign");
11315
+ const utmContent = searchParams.get("utm_content");
11316
+ const utmValues = [utmSource, utmMedium, utmCampaign, utmContent].filter(
11317
+ (value) => Boolean(value)
11318
+ );
11312
11319
  const adClickId = this.adManager.clickId;
11313
11320
  if (core.Capacitor.isNativePlatform()) {
11314
11321
  const platform = core.Capacitor.getPlatform();
@@ -11320,12 +11327,12 @@ var Sdk = class {
11320
11327
  return;
11321
11328
  }
11322
11329
  const currentDomain = sessionStorage.getItem("domain");
11323
- if (market) {
11324
- sessionStorage.setItem("domain", `${hostname}/${market}`);
11325
- } else if (adClickId && !currentDomain) {
11326
- sessionStorage.setItem("domain", `${hostname}/meta-ads`);
11327
- } else if (!currentDomain) {
11328
- sessionStorage.setItem("domain", hostname);
11330
+ const marketDomain = market ? `${hostname}/${market}` : null;
11331
+ const utmDomain = utmValues.length ? `${hostname}/${utmValues.join("-")}` : null;
11332
+ const fallbackDomain = currentDomain ? null : adClickId ? `${hostname}/meta-ads` : hostname;
11333
+ const nextDomain = marketDomain ?? utmDomain ?? fallbackDomain;
11334
+ if (nextDomain) {
11335
+ sessionStorage.setItem("domain", nextDomain);
11329
11336
  }
11330
11337
  if (market) {
11331
11338
  setTimeout(() => {