@jitsu/js 1.9.9-canary.1019.20241028095115 → 1.9.9

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/jitsu.cjs.js CHANGED
@@ -418,7 +418,21 @@ var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _argu
418
418
  step((generator = generator.apply(thisArg, _arguments || [])).next());
419
419
  });
420
420
  };
421
- const defaultScriptSrc = "googletagmanager.com/gtag/js";
421
+ const urlData = [
422
+ new Uint8Array([109, 111, 99, 46, 114, 101, 103, 97, 110, 97, 109, 103, 97, 116, 101, 108, 103, 111, 111, 103]),
423
+ new Uint8Array([103, 97, 116, 103]),
424
+ new Uint8Array([115, 106]),
425
+ ];
426
+ function byteArrayToString(byteArray) {
427
+ const decoder = new TextDecoder();
428
+ return decoder.decode(byteArray);
429
+ }
430
+ function buildTagUrl() {
431
+ return urlData
432
+ .map(d => d.reverse())
433
+ .map(byteArrayToString)
434
+ .join("/");
435
+ }
422
436
  const ga4Plugin = {
423
437
  id: "ga4-tag",
424
438
  handle(config, payload) {
@@ -489,7 +503,7 @@ function initGa4IfNeeded(config, payload) {
489
503
  gtag(
490
504
  // @ts-ignore
491
505
  "config", tagId, Object.assign(Object.assign({}, (payload.userId ? { user_id: payload.userId } : {})), (!config.autoPageView ? { send_page_view: false } : {})));
492
- loadScript(defaultScriptSrc, { query: `id=${tagId}${dlParam}`, www: true })
506
+ loadScript(buildTagUrl(), { query: `id=${tagId}${dlParam}`, www: true })
493
507
  .then(() => {
494
508
  setGa4State("loaded");
495
509
  })
package/dist/jitsu.es.js CHANGED
@@ -416,7 +416,21 @@ var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _argu
416
416
  step((generator = generator.apply(thisArg, _arguments || [])).next());
417
417
  });
418
418
  };
419
- const defaultScriptSrc = "googletagmanager.com/gtag/js";
419
+ const urlData = [
420
+ new Uint8Array([109, 111, 99, 46, 114, 101, 103, 97, 110, 97, 109, 103, 97, 116, 101, 108, 103, 111, 111, 103]),
421
+ new Uint8Array([103, 97, 116, 103]),
422
+ new Uint8Array([115, 106]),
423
+ ];
424
+ function byteArrayToString(byteArray) {
425
+ const decoder = new TextDecoder();
426
+ return decoder.decode(byteArray);
427
+ }
428
+ function buildTagUrl() {
429
+ return urlData
430
+ .map(d => d.reverse())
431
+ .map(byteArrayToString)
432
+ .join("/");
433
+ }
420
434
  const ga4Plugin = {
421
435
  id: "ga4-tag",
422
436
  handle(config, payload) {
@@ -487,7 +501,7 @@ function initGa4IfNeeded(config, payload) {
487
501
  gtag(
488
502
  // @ts-ignore
489
503
  "config", tagId, Object.assign(Object.assign({}, (payload.userId ? { user_id: payload.userId } : {})), (!config.autoPageView ? { send_page_view: false } : {})));
490
- loadScript(defaultScriptSrc, { query: `id=${tagId}${dlParam}`, www: true })
504
+ loadScript(buildTagUrl(), { query: `id=${tagId}${dlParam}`, www: true })
491
505
  .then(() => {
492
506
  setGa4State("loaded");
493
507
  })
package/dist/web/p.js.txt CHANGED
@@ -419,7 +419,21 @@
419
419
  step((generator = generator.apply(thisArg, _arguments || [])).next());
420
420
  });
421
421
  };
422
- const defaultScriptSrc = "googletagmanager.com/gtag/js";
422
+ const urlData = [
423
+ new Uint8Array([109, 111, 99, 46, 114, 101, 103, 97, 110, 97, 109, 103, 97, 116, 101, 108, 103, 111, 111, 103]),
424
+ new Uint8Array([103, 97, 116, 103]),
425
+ new Uint8Array([115, 106]),
426
+ ];
427
+ function byteArrayToString(byteArray) {
428
+ const decoder = new TextDecoder();
429
+ return decoder.decode(byteArray);
430
+ }
431
+ function buildTagUrl() {
432
+ return urlData
433
+ .map(d => d.reverse())
434
+ .map(byteArrayToString)
435
+ .join("/");
436
+ }
423
437
  const ga4Plugin = {
424
438
  id: "ga4-tag",
425
439
  handle(config, payload) {
@@ -490,7 +504,7 @@
490
504
  gtag(
491
505
  // @ts-ignore
492
506
  "config", tagId, Object.assign(Object.assign({}, (payload.userId ? { user_id: payload.userId } : {})), (!config.autoPageView ? { send_page_view: false } : {})));
493
- loadScript(defaultScriptSrc, { query: `id=${tagId}${dlParam}`, www: true })
507
+ loadScript(buildTagUrl(), { query: `id=${tagId}${dlParam}`, www: true })
494
508
  .then(() => {
495
509
  setGa4State("loaded");
496
510
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/js",
3
- "version": "1.9.9-canary.1019.20241028095115",
3
+ "version": "1.9.9",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "main": "dist/jitsu.cjs.js",
@@ -20,23 +20,23 @@
20
20
  "@rollup/plugin-node-resolve": "^15.0.1",
21
21
  "@rollup/plugin-replace": "^5.0.1",
22
22
  "@rollup/plugin-terser": "^0.1.0",
23
- "@segment/analytics-next": "^1.46.0",
23
+ "@segment/analytics-next": "^1.75.0",
24
24
  "@types/chalk": "^2.2.0",
25
25
  "@types/jest": "^29.2.0",
26
26
  "@types/node": "^18.15.3",
27
27
  "chalk": "^4.1.2",
28
- "cookie-parser": "^1.4.6",
28
+ "cookie-parser": "^1.4.7",
29
29
  "ejs": "^3.1.8",
30
30
  "express": "^4.21.1",
31
31
  "jest": "^29.2.2",
32
32
  "node-fetch-commonjs": "^3.3.2",
33
33
  "node-forge": "^1.3.1",
34
34
  "raw-loader": "^4.0.2",
35
- "rollup": "^3.2.5",
35
+ "rollup": "^3.29.5",
36
36
  "ts-jest": "29.0.5",
37
37
  "typescript": "^5.6.3",
38
- "@jitsu/protocols": "1.9.9-canary.1019.20241028095115",
39
- "jsondiffpatch": "1.9.9-canary.1019.20241028095115"
38
+ "@jitsu/protocols": "1.9.9",
39
+ "jsondiffpatch": "1.9.9"
40
40
  },
41
41
  "dependencies": {
42
42
  "analytics": "0.8.9"
@@ -2,7 +2,23 @@ import { loadScript } from "../script-loader";
2
2
  import { AnalyticsClientEvent } from "@jitsu/protocols/analytics";
3
3
  import { applyFilters, CommonDestinationCredentials, InternalPlugin } from "./index";
4
4
 
5
- const defaultScriptSrc = "googletagmanager.com/gtag/js";
5
+ const urlData = [
6
+ new Uint8Array([109, 111, 99, 46, 114, 101, 103, 97, 110, 97, 109, 103, 97, 116, 101, 108, 103, 111, 111, 103]),
7
+ new Uint8Array([103, 97, 116, 103]),
8
+ new Uint8Array([115, 106]),
9
+ ];
10
+
11
+ function byteArrayToString(byteArray: Uint8Array): string {
12
+ const decoder = new TextDecoder();
13
+ return decoder.decode(byteArray);
14
+ }
15
+
16
+ function buildTagUrl() {
17
+ return urlData
18
+ .map(d => d.reverse())
19
+ .map(byteArrayToString)
20
+ .join("/");
21
+ }
6
22
 
7
23
  export type Ga4DestinationCredentials = {
8
24
  debug?: boolean;
@@ -111,7 +127,7 @@ async function initGa4IfNeeded(config: Ga4DestinationCredentials, payload: Analy
111
127
  }
112
128
  );
113
129
 
114
- loadScript(defaultScriptSrc, { query: `id=${tagId}${dlParam}`, www: true })
130
+ loadScript(buildTagUrl(), { query: `id=${tagId}${dlParam}`, www: true })
115
131
  .then(() => {
116
132
  setGa4State("loaded");
117
133
  })