@jitsu/js 1.9.17 → 1.9.18-canary.1269.20250403142744
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 +2 -1
- package/dist/jitsu.d.ts +1 -12
- package/dist/jitsu.es.js +2 -1
- package/dist/web/p.js.txt +2 -1
- package/package.json +9 -3
- package/.turbo/turbo-build.log +0 -67
- package/.turbo/turbo-clean.log +0 -5
- package/.turbo/turbo-test.log +0 -4665
- package/__tests__/node/method-queue.test.ts +0 -66
- package/__tests__/node/nodejs.test.ts +0 -306
- package/__tests__/playwright/cases/anonymous-id-bug.html +0 -26
- package/__tests__/playwright/cases/basic.html +0 -32
- package/__tests__/playwright/cases/callbacks.html +0 -21
- package/__tests__/playwright/cases/cookie-names.html +0 -22
- package/__tests__/playwright/cases/disable-user-ids.html +0 -23
- package/__tests__/playwright/cases/dont-send.html +0 -22
- package/__tests__/playwright/cases/ip-policy.html +0 -22
- package/__tests__/playwright/cases/reset.html +0 -32
- package/__tests__/playwright/cases/segment-reference.html +0 -64
- package/__tests__/playwright/cases/url-bug.html +0 -20
- package/__tests__/playwright/integration.test.ts +0 -640
- package/__tests__/simple-syrup.ts +0 -136
- package/jest.config.js +0 -13
- package/playwrite.config.ts +0 -91
- package/rollup.config.js +0 -32
- package/src/analytics-plugin.ts +0 -993
- package/src/browser.ts +0 -163
- package/src/destination-plugins/ga4.ts +0 -138
- package/src/destination-plugins/gtm.ts +0 -142
- package/src/destination-plugins/index.ts +0 -61
- package/src/destination-plugins/logrocket.ts +0 -85
- package/src/destination-plugins/tag.ts +0 -85
- package/src/index.ts +0 -255
- package/src/method-queue.ts +0 -70
- package/src/script-loader.ts +0 -76
- package/src/tlds.ts +0 -27
- package/src/version.ts +0 -6
- package/tsconfig.json +0 -23
- package/tsconfig.test.json +0 -15
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { delayMethodExec } from "../../src/method-queue";
|
|
2
|
-
import { expect } from "@playwright/test";
|
|
3
|
-
|
|
4
|
-
interface ITest {
|
|
5
|
-
method(str: string, num: number): string;
|
|
6
|
-
|
|
7
|
-
_internalMethod(str: string, num: number): string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface AsyncInterface {
|
|
11
|
-
method(str: string, num: number): Promise<string>;
|
|
12
|
-
|
|
13
|
-
_internalMethod(str: string, num: number);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
test("method-queue", async () => {
|
|
17
|
-
const testResult: string[] = [];
|
|
18
|
-
const wrap = delayMethodExec<ITest>({
|
|
19
|
-
method: true,
|
|
20
|
-
_internalMethod: false,
|
|
21
|
-
});
|
|
22
|
-
const instance = wrap.get();
|
|
23
|
-
const wrapPromise = instance.method("a", 1).then(res => testResult.push(res));
|
|
24
|
-
|
|
25
|
-
expect(testResult).toEqual([]);
|
|
26
|
-
expect(() => instance._internalMethod("a", 1)).toThrowError();
|
|
27
|
-
|
|
28
|
-
wrap.loaded({
|
|
29
|
-
_internalMethod(str, num) {
|
|
30
|
-
return `${str}${num}`;
|
|
31
|
-
},
|
|
32
|
-
method(str, num) {
|
|
33
|
-
const result = this._internalMethod(str, num);
|
|
34
|
-
testResult.push(result);
|
|
35
|
-
return `result:${result}`;
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
await wrapPromise;
|
|
39
|
-
|
|
40
|
-
expect(testResult).toEqual(["a1", "result:a1"]);
|
|
41
|
-
|
|
42
|
-
instance.method("b", 2);
|
|
43
|
-
expect(testResult).toEqual(["a1", "result:a1", "b2"]);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
test("test-async", async () => {
|
|
47
|
-
const testResult: string[] = [];
|
|
48
|
-
const wrap = delayMethodExec<AsyncInterface>({
|
|
49
|
-
method: true,
|
|
50
|
-
_internalMethod: false,
|
|
51
|
-
});
|
|
52
|
-
const instance = wrap.get();
|
|
53
|
-
const wrapPromise = instance.method("a", 1).then(res => testResult.push(res));
|
|
54
|
-
|
|
55
|
-
wrap.loaded({
|
|
56
|
-
_internalMethod(str, num) {
|
|
57
|
-
return `${str}${num}`;
|
|
58
|
-
},
|
|
59
|
-
async method(str, num) {
|
|
60
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
61
|
-
return `result:${this._internalMethod(str, num)}`;
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
await wrapPromise;
|
|
65
|
-
expect(testResult).toEqual(["result:a1"]);
|
|
66
|
-
});
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { createServer, SimpleSyrup } from "../simple-syrup";
|
|
2
|
-
import { AnalyticsClientEvent, AnalyticsInterface } from "@jitsu/protocols/analytics";
|
|
3
|
-
import { getTopLevelDomain } from "../../src/tlds";
|
|
4
|
-
|
|
5
|
-
const jitsuAnalytics = require("../../dist/jitsu.cjs.js").jitsuAnalytics;
|
|
6
|
-
const fetchImpl = require("node-fetch-commonjs");
|
|
7
|
-
|
|
8
|
-
describe("Test Jitsu NodeJS client", () => {
|
|
9
|
-
let server: SimpleSyrup;
|
|
10
|
-
|
|
11
|
-
let requestLog: { type: string; body: AnalyticsClientEvent }[] = [];
|
|
12
|
-
|
|
13
|
-
const startServer = async () => {
|
|
14
|
-
requestLog = [];
|
|
15
|
-
let handler = (req, res) => {
|
|
16
|
-
res.setHeader("Content-Type", "text/javascript");
|
|
17
|
-
res.send({ ok: true });
|
|
18
|
-
requestLog.push({
|
|
19
|
-
type: req.params.type,
|
|
20
|
-
body: req.body,
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
server = await createServer({
|
|
24
|
-
port: 3088,
|
|
25
|
-
https: false,
|
|
26
|
-
handlers: {
|
|
27
|
-
//we're using same handler for s2s and browser events since
|
|
28
|
-
//we don't check types anyway
|
|
29
|
-
"/api/s/:type": handler,
|
|
30
|
-
"/api/s/s2s/:type": handler,
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
console.log("Running on " + server.baseUrl);
|
|
34
|
-
};
|
|
35
|
-
const shutdownServer = async () => {
|
|
36
|
-
console.log("Shutting down server " + server.baseUrl);
|
|
37
|
-
await server.close();
|
|
38
|
-
console.log("Server is down " + server.baseUrl);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
beforeAll(async () => {
|
|
42
|
-
await startServer();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
beforeEach(() => {
|
|
46
|
-
requestLog = [];
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
afterAll(async () => {
|
|
50
|
-
await shutdownServer();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("setAnonymousId test2", async () => {
|
|
54
|
-
const config = {
|
|
55
|
-
host: server.baseUrl,
|
|
56
|
-
writeKey: "key:secret",
|
|
57
|
-
debug: true,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
console.log("[JITSU TEST] Initializing Jitsu");
|
|
61
|
-
const client = jitsuAnalytics(config);
|
|
62
|
-
console.log("[JITSU TEST] Jitsu instance", client);
|
|
63
|
-
|
|
64
|
-
const anonymousId = "anonymous_id_test";
|
|
65
|
-
console.log("[JITSU TEST] Setting anonymous id to " + anonymousId);
|
|
66
|
-
await client.setAnonymousId(anonymousId);
|
|
67
|
-
console.log("user state", client.getState("user"));
|
|
68
|
-
|
|
69
|
-
expect(requestLog.length).toBe(0);
|
|
70
|
-
console.log("[JITSU TEST] Sending event EVENT_1");
|
|
71
|
-
await client.track("EVENT_1");
|
|
72
|
-
await client.track("EVENT_2");
|
|
73
|
-
await client.track("groupId");
|
|
74
|
-
|
|
75
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
76
|
-
|
|
77
|
-
expect(requestLog.length).toBe(3);
|
|
78
|
-
expect(requestLog[1].body.anonymousId).toBe("anonymous_id_test");
|
|
79
|
-
expect(requestLog[0].body.anonymousId).toBe("anonymous_id_test");
|
|
80
|
-
expect(requestLog[2].body.anonymousId).toBe("anonymous_id_test");
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
test("test privacy dontSend", async () => {
|
|
84
|
-
const config = {
|
|
85
|
-
host: server.baseUrl,
|
|
86
|
-
writeKey: "key:secret",
|
|
87
|
-
debug: true,
|
|
88
|
-
privacy: {
|
|
89
|
-
dontSend: true,
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
const client = jitsuAnalytics(config);
|
|
93
|
-
expect(requestLog.length).toBe(0);
|
|
94
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
95
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
96
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
97
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
98
|
-
expect(requestLog.length).toBe(0);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test("test privacy dontSend then consent", async () => {
|
|
102
|
-
const config = {
|
|
103
|
-
host: server.baseUrl,
|
|
104
|
-
writeKey: "key:secret",
|
|
105
|
-
debug: true,
|
|
106
|
-
privacy: {
|
|
107
|
-
dontSend: true,
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
const client = jitsuAnalytics(config);
|
|
111
|
-
expect(requestLog.length).toBe(0);
|
|
112
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
113
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
114
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
115
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
116
|
-
expect(requestLog.length).toBe(0);
|
|
117
|
-
|
|
118
|
-
client.configure({
|
|
119
|
-
privacy: {
|
|
120
|
-
dontSend: false,
|
|
121
|
-
consentCategories: {
|
|
122
|
-
analytics: true,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
127
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
128
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
129
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
130
|
-
|
|
131
|
-
expect(requestLog.length).toBe(3);
|
|
132
|
-
const p = requestLog[2];
|
|
133
|
-
expect(p.type).toEqual("track");
|
|
134
|
-
expect(p.body.event).toBe("myEvent");
|
|
135
|
-
expect(p.body.userId).toEqual("myUserId");
|
|
136
|
-
expect(p.body.groupId).toEqual("myGroupId");
|
|
137
|
-
expect(p.body.context?.traits?.email).toEqual("myUserId@example.com");
|
|
138
|
-
expect(p.body.context?.consent?.categoryPreferences).toEqual({ analytics: true });
|
|
139
|
-
expect((p.body.anonymousId ?? "").length).toBeGreaterThan(0);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
test("test privacy disableUserIds", async () => {
|
|
143
|
-
const config = {
|
|
144
|
-
host: server.baseUrl,
|
|
145
|
-
writeKey: "key:secret",
|
|
146
|
-
debug: true,
|
|
147
|
-
privacy: {
|
|
148
|
-
disableUserIds: true,
|
|
149
|
-
},
|
|
150
|
-
};
|
|
151
|
-
const client = jitsuAnalytics(config);
|
|
152
|
-
expect(requestLog.length).toBe(0);
|
|
153
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
154
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
155
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
156
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
157
|
-
expect(requestLog.length).toBe(1);
|
|
158
|
-
const p = requestLog[0];
|
|
159
|
-
expect(p.type).toEqual("track");
|
|
160
|
-
expect(p.body.event).toBe("myEvent");
|
|
161
|
-
expect(p.body.userId).toBeUndefined();
|
|
162
|
-
expect(p.body.groupId).toBeUndefined();
|
|
163
|
-
expect(p.body.context?.traits?.email).toBeUndefined();
|
|
164
|
-
expect(p.body.anonymousId).toBeUndefined();
|
|
165
|
-
expect(p.body.properties?.prop1).toBe("value1");
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
test("test privacy disableUserIds then consent", async () => {
|
|
169
|
-
const config = {
|
|
170
|
-
host: server.baseUrl,
|
|
171
|
-
writeKey: "key:secret",
|
|
172
|
-
debug: true,
|
|
173
|
-
privacy: {
|
|
174
|
-
disableUserIds: true,
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
const client = jitsuAnalytics(config);
|
|
178
|
-
expect(requestLog.length).toBe(0);
|
|
179
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
180
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
181
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
182
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
183
|
-
expect(requestLog.length).toBe(1);
|
|
184
|
-
let p = requestLog[0];
|
|
185
|
-
expect(p.type).toEqual("track");
|
|
186
|
-
expect(p.body.event).toBe("myEvent");
|
|
187
|
-
expect(p.body.userId).toBeUndefined();
|
|
188
|
-
expect(p.body.groupId).toBeUndefined();
|
|
189
|
-
expect(p.body.context?.traits?.email).toBeUndefined();
|
|
190
|
-
expect(p.body.anonymousId).toBeUndefined();
|
|
191
|
-
expect(p.body.properties?.prop1).toBe("value1");
|
|
192
|
-
|
|
193
|
-
client.configure({
|
|
194
|
-
privacy: {
|
|
195
|
-
disableUserIds: false,
|
|
196
|
-
consentCategories: {
|
|
197
|
-
analytics: true,
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
202
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
203
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
204
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
205
|
-
|
|
206
|
-
expect(requestLog.length).toBe(4);
|
|
207
|
-
p = requestLog[3];
|
|
208
|
-
expect(p.type).toEqual("track");
|
|
209
|
-
expect(p.body.event).toBe("myEvent");
|
|
210
|
-
expect(p.body.userId).toEqual("myUserId");
|
|
211
|
-
expect(p.body.groupId).toEqual("myGroupId");
|
|
212
|
-
expect(p.body.context?.traits?.email).toEqual("myUserId@example.com");
|
|
213
|
-
expect(p.body.context?.consent?.categoryPreferences).toEqual({ analytics: true });
|
|
214
|
-
expect((p.body.anonymousId ?? "").length).toBeGreaterThan(0);
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
test("test defaultPayloadContext", async () => {
|
|
218
|
-
const config = {
|
|
219
|
-
host: server.baseUrl,
|
|
220
|
-
writeKey: "key:secret",
|
|
221
|
-
debug: true,
|
|
222
|
-
defaultPayloadContext: {
|
|
223
|
-
awesomeIdentifier: "awesome-identifier",
|
|
224
|
-
awesome: {
|
|
225
|
-
nestedKey: "awesome-key",
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
const client = jitsuAnalytics(config);
|
|
230
|
-
expect(requestLog.length).toBe(0);
|
|
231
|
-
await client.identify("myUserId", { email: "myUserId@example.com" });
|
|
232
|
-
await client.group("myGroupId", { name: "myGroupId" });
|
|
233
|
-
await client.track("myEvent", { prop1: "value1" });
|
|
234
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
235
|
-
expect(requestLog.length).toBe(3);
|
|
236
|
-
expect(requestLog[0].body.context.awesomeIdentifier).toBe("awesome-identifier");
|
|
237
|
-
expect(requestLog[0].body.context.awesome.nestedKey).toBe("awesome-key");
|
|
238
|
-
expect(requestLog[1].body.context.awesomeIdentifier).toBe("awesome-identifier");
|
|
239
|
-
expect(requestLog[1].body.context.awesome.nestedKey).toBe("awesome-key");
|
|
240
|
-
expect(requestLog[2].body.context.awesomeIdentifier).toBe("awesome-identifier");
|
|
241
|
-
expect(requestLog[2].body.context.awesome.nestedKey).toBe("awesome-key");
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
test("node js", async () => {
|
|
245
|
-
const jitsu: AnalyticsInterface = jitsuAnalytics({
|
|
246
|
-
writeKey: "key:secret",
|
|
247
|
-
host: server.baseUrl,
|
|
248
|
-
debug: true,
|
|
249
|
-
fetch: fetchImpl,
|
|
250
|
-
});
|
|
251
|
-
await jitsu.track("testTrack");
|
|
252
|
-
|
|
253
|
-
await jitsu.identify("testUser", {
|
|
254
|
-
email: "test@test.com",
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
await jitsu.group("testGroup", {
|
|
258
|
-
name: "Test Group",
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
await jitsu.page({
|
|
262
|
-
name: "test",
|
|
263
|
-
environment: "nodejs",
|
|
264
|
-
context: {
|
|
265
|
-
page: {
|
|
266
|
-
url: "http://server.com",
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
});
|
|
270
|
-
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
271
|
-
expect(requestLog.length).toBe(4);
|
|
272
|
-
expect(requestLog[0].type).toBe("track");
|
|
273
|
-
expect(requestLog[1].type).toBe("identify");
|
|
274
|
-
expect(requestLog[2].type).toBe("group");
|
|
275
|
-
expect(requestLog[3].type).toBe("page");
|
|
276
|
-
|
|
277
|
-
const track = requestLog[0].body as AnalyticsClientEvent;
|
|
278
|
-
const identify = requestLog[1].body as AnalyticsClientEvent;
|
|
279
|
-
const group = requestLog[2].body as AnalyticsClientEvent;
|
|
280
|
-
const page = requestLog[3].body as AnalyticsClientEvent;
|
|
281
|
-
|
|
282
|
-
//expect(track.userId).toBe(undefined);
|
|
283
|
-
expect(page.properties.name).toBe("test");
|
|
284
|
-
expect(page.properties?.environment).toBe("nodejs");
|
|
285
|
-
expect(page.context.page.url).toBe("http://server.com");
|
|
286
|
-
expect(page.userId).toBe("testUser");
|
|
287
|
-
expect(identify.traits.email).toBe("test@test.com");
|
|
288
|
-
expect(identify.anonymousId).toBe(page.anonymousId);
|
|
289
|
-
expect(group.traits.name).toBe("Test Group");
|
|
290
|
-
expect(group.anonymousId).toBe(page.anonymousId);
|
|
291
|
-
expect(group.userId).toBe("testUser");
|
|
292
|
-
expect(group.groupId).toBe("testGroup");
|
|
293
|
-
|
|
294
|
-
const pagePayload = requestLog[0].body;
|
|
295
|
-
console.log("pagePayload", pagePayload);
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
test("tld", async () => {
|
|
299
|
-
expect(getTopLevelDomain("www.google.com")).toBe("google.com");
|
|
300
|
-
expect(getTopLevelDomain("www.trendstyle.com.au")).toBe("trendstyle.com.au");
|
|
301
|
-
expect(getTopLevelDomain("localhost:3000")).toBe("localhost");
|
|
302
|
-
expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
|
|
303
|
-
expect(getTopLevelDomain("use.jitsu.com")).toBe("jitsu.com");
|
|
304
|
-
//console.log(parse("http://localhost:3000"));
|
|
305
|
-
});
|
|
306
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
<script>
|
|
10
|
-
window.testOnload = async j => {
|
|
11
|
-
j.track("pageLoaded");
|
|
12
|
-
};
|
|
13
|
-
</script>
|
|
14
|
-
<script
|
|
15
|
-
type="text/javascript"
|
|
16
|
-
src="<%=trackingBase%>/p.js"
|
|
17
|
-
data-onload="testOnload"
|
|
18
|
-
data-debug="true"
|
|
19
|
-
defer
|
|
20
|
-
></script>
|
|
21
|
-
</head>
|
|
22
|
-
|
|
23
|
-
<body>
|
|
24
|
-
<h1>Test</h1>
|
|
25
|
-
</body>
|
|
26
|
-
</html>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
<script>
|
|
10
|
-
window.jitsuConfig = {
|
|
11
|
-
cookieCapture: {
|
|
12
|
-
ttp: "_ttp",
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
window.testOnload = async j => {
|
|
16
|
-
j.identify("john-doe-id-1", { email: "john.doe@gmail.com" });
|
|
17
|
-
j.track("pageLoaded", { trackParam: "trackValue" });
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
<script
|
|
21
|
-
type="text/javascript"
|
|
22
|
-
src="<%=trackingBase%>/p.js"
|
|
23
|
-
data-onload="testOnload"
|
|
24
|
-
data-debug="true"
|
|
25
|
-
defer
|
|
26
|
-
></script>
|
|
27
|
-
</head>
|
|
28
|
-
|
|
29
|
-
<body>
|
|
30
|
-
<h1>Test</h1>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<title>Tracking page</title>
|
|
8
|
-
<script type="text/javascript" src="<%=trackingBase%>/p.js" defer></script>
|
|
9
|
-
<script>
|
|
10
|
-
(window.jitsuQ = window.jitsuQ || []).push(function (jitsu) {
|
|
11
|
-
jitsu.track("test-event1");
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
(window.jitsuQ = window.jitsuQ || []).push(["track", "test-event2"]);
|
|
15
|
-
</script>
|
|
16
|
-
</head>
|
|
17
|
-
|
|
18
|
-
<body>
|
|
19
|
-
<h1>Test</h1>
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
<script
|
|
10
|
-
type="text/javascript"
|
|
11
|
-
src="<%=trackingBase%>/p.js"
|
|
12
|
-
data-onload="testOnload"
|
|
13
|
-
data-cookie-names='{"anonymousId":"my_anon_ck"}'
|
|
14
|
-
data-debug="true"
|
|
15
|
-
defer
|
|
16
|
-
></script>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<h1>Test</h1>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
|
|
10
|
-
<script
|
|
11
|
-
type="text/javascript"
|
|
12
|
-
src="<%=trackingBase%>/p.js"
|
|
13
|
-
data-privacy-disable-user-ids="true"
|
|
14
|
-
data-init-only="true"
|
|
15
|
-
data-debug="true"
|
|
16
|
-
defer
|
|
17
|
-
></script>
|
|
18
|
-
</head>
|
|
19
|
-
|
|
20
|
-
<body>
|
|
21
|
-
<h1>Test</h1>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
|
|
10
|
-
<script
|
|
11
|
-
type="text/javascript"
|
|
12
|
-
src="<%=trackingBase%>/p.js"
|
|
13
|
-
data-privacy-dont-send="true"
|
|
14
|
-
data-debug="true"
|
|
15
|
-
defer
|
|
16
|
-
></script>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<h1>Test</h1>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
|
|
10
|
-
<script
|
|
11
|
-
type="text/javascript"
|
|
12
|
-
src="<%=trackingBase%>/p.js"
|
|
13
|
-
data-privacy-ip-policy="stripLastOctet"
|
|
14
|
-
data-debug="true"
|
|
15
|
-
defer
|
|
16
|
-
></script>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<h1>Test</h1>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
<script>
|
|
10
|
-
window.testOnload = async j => {
|
|
11
|
-
await j.setAnonymousId("john-doe-id-1");
|
|
12
|
-
await j.identify("john-nondoe", { email: "john@example.com" });
|
|
13
|
-
await j.identify("john-nondoe", { email: "john2@example.com", $doNotSend: true });
|
|
14
|
-
await j.track("pageLoaded", { trackParam: "trackValue" });
|
|
15
|
-
await j.reset();
|
|
16
|
-
await j.track("pageLoaded", { trackParam: "trackValue" });
|
|
17
|
-
};
|
|
18
|
-
</script>
|
|
19
|
-
<script
|
|
20
|
-
type="text/javascript"
|
|
21
|
-
src="<%=trackingBase%>/p.js"
|
|
22
|
-
data-onload="testOnload"
|
|
23
|
-
data-debug="true"
|
|
24
|
-
data-init-only="true"
|
|
25
|
-
defer
|
|
26
|
-
></script>
|
|
27
|
-
</head>
|
|
28
|
-
|
|
29
|
-
<body>
|
|
30
|
-
<h1>Test</h1>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
<head>
|
|
3
|
-
<script type="text/javascript">
|
|
4
|
-
!(function () {
|
|
5
|
-
var analytics = (window.analytics = window.analytics || []);
|
|
6
|
-
if (!analytics.initialize)
|
|
7
|
-
if (analytics.invoked) window.console && console.error && console.error("Segment snippet included twice.");
|
|
8
|
-
else {
|
|
9
|
-
analytics.invoked = !0;
|
|
10
|
-
analytics.methods = [
|
|
11
|
-
"trackSubmit",
|
|
12
|
-
"trackClick",
|
|
13
|
-
"trackLink",
|
|
14
|
-
"trackForm",
|
|
15
|
-
"pageview",
|
|
16
|
-
"identify",
|
|
17
|
-
"reset",
|
|
18
|
-
"group",
|
|
19
|
-
"track",
|
|
20
|
-
"ready",
|
|
21
|
-
"alias",
|
|
22
|
-
"debug",
|
|
23
|
-
"page",
|
|
24
|
-
"once",
|
|
25
|
-
"off",
|
|
26
|
-
"on",
|
|
27
|
-
"addSourceMiddleware",
|
|
28
|
-
"addIntegrationMiddleware",
|
|
29
|
-
"setAnonymousId",
|
|
30
|
-
"addDestinationMiddleware",
|
|
31
|
-
];
|
|
32
|
-
analytics.factory = function (e) {
|
|
33
|
-
return function () {
|
|
34
|
-
var t = Array.prototype.slice.call(arguments);
|
|
35
|
-
t.unshift(e);
|
|
36
|
-
analytics.push(t);
|
|
37
|
-
return analytics;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
for (var e = 0; e < analytics.methods.length; e++) {
|
|
41
|
-
var key = analytics.methods[e];
|
|
42
|
-
analytics[key] = analytics.factory(key);
|
|
43
|
-
}
|
|
44
|
-
analytics.load = function (key, e) {
|
|
45
|
-
var t = document.createElement("script");
|
|
46
|
-
t.type = "text/javascript";
|
|
47
|
-
t.async = !0;
|
|
48
|
-
t.src = "https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";
|
|
49
|
-
var n = document.getElementsByTagName("script")[0];
|
|
50
|
-
n.parentNode.insertBefore(t, n);
|
|
51
|
-
analytics._loadOptions = e;
|
|
52
|
-
};
|
|
53
|
-
analytics._writeKey = "<%= process.env.SEGMENT_WRITE_KEY%>";
|
|
54
|
-
analytics.SNIPPET_VERSION = "4.15.3";
|
|
55
|
-
analytics.load("<%= process.env.SEGMENT_WRITE_KEY%>");
|
|
56
|
-
|
|
57
|
-
analytics.ready(() => {
|
|
58
|
-
window.__analyticsReady = true;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
})();
|
|
62
|
-
</script>
|
|
63
|
-
</head>
|
|
64
|
-
</html>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<link rel="canonical" href="<%=trackingBase%>" />
|
|
8
|
-
<title>Tracking page</title>
|
|
9
|
-
<script type="text/javascript" src="<%=trackingBase%>/p.js" data-debug="true" defer></script>
|
|
10
|
-
<script>
|
|
11
|
-
(window.jitsuQ = window.jitsuQ || []).push(function (jitsu) {
|
|
12
|
-
jitsu.track("test-event");
|
|
13
|
-
});
|
|
14
|
-
</script>
|
|
15
|
-
</head>
|
|
16
|
-
|
|
17
|
-
<body>
|
|
18
|
-
<h1>Test</h1>
|
|
19
|
-
</body>
|
|
20
|
-
</html>
|