rozmova-analytics 1.0.2 → 1.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.
Files changed (2) hide show
  1. package/dist/helpers.js +3 -2
  2. package/package.json +1 -2
package/dist/helpers.js CHANGED
@@ -82,7 +82,8 @@ function detectOS() {
82
82
  var getDomain = exports.getDomain = function getDomain() {
83
83
  var domainParts = window.location.hostname.split(".");
84
84
  var domainPartsLength = domainParts.length;
85
- return domainParts[domainPartsLength - 2] + "." + domainParts[domainPartsLength - 1];
85
+ if (domainParts.length === 1) return domainParts[0];
86
+ return domainParts.slice(domainPartsLength - 2, domainPartsLength).join(".");
86
87
  };
87
88
  var getReferrer = exports.getReferrer = function getReferrer() {
88
89
  var referrer = document.referrer;
@@ -145,7 +146,7 @@ function getGASessionId() {
145
146
  return null;
146
147
  }
147
148
  var _waitForGA = exports.waitForGA = function waitForGA(callback) {
148
- if (getGASessionId()) callback();else setTimeout(function () {
149
+ if (getGASessionId() && getGAClientId()) callback();else setTimeout(function () {
149
150
  return _waitForGA(callback);
150
151
  }, 1000);
151
152
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rozmova-analytics",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "A collection of JavaScript functions for Rozmova analytics",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -44,7 +44,6 @@
44
44
  "typescript": "^5.7.2"
45
45
  },
46
46
  "dependencies": {
47
- "dotenv": "^16.4.7",
48
47
  "js-cookie": "^3.0.5",
49
48
  "mixpanel-browser": "^2.58.0",
50
49
  "nanoid": "^5.0.9"