@uniformdev/context-gtag 19.131.1-alpha.8 → 19.133.0

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.esm.js CHANGED
@@ -11,7 +11,6 @@ var enableGoogleGtagAnalytics = (options) => {
11
11
  return {
12
12
  init: (context) => {
13
13
  const onPersonalizationResult = (result) => {
14
- var _a;
15
14
  if (!isGtagConfigured()) {
16
15
  context.log("warn", 700);
17
16
  return;
@@ -19,10 +18,13 @@ var enableGoogleGtagAnalytics = (options) => {
19
18
  if (!emitAll && !result.changed) {
20
19
  return;
21
20
  }
22
- (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
23
- event_category: "Uniform Personalization",
24
- event_label: result.variantIds.join(", "),
25
- is_control_group: result.control ? 1 : 0
21
+ result.variantIds.forEach((variant) => {
22
+ var _a;
23
+ (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
24
+ event_category: "Uniform Personalization",
25
+ event_label: variant.id,
26
+ is_control_group: result.control || variant.control ? 1 : 0
27
+ });
26
28
  });
27
29
  };
28
30
  const onTestResult = (result) => {
package/dist/index.js CHANGED
@@ -35,7 +35,6 @@ var enableGoogleGtagAnalytics = (options) => {
35
35
  return {
36
36
  init: (context) => {
37
37
  const onPersonalizationResult = (result) => {
38
- var _a;
39
38
  if (!isGtagConfigured()) {
40
39
  context.log("warn", 700);
41
40
  return;
@@ -43,10 +42,13 @@ var enableGoogleGtagAnalytics = (options) => {
43
42
  if (!emitAll && !result.changed) {
44
43
  return;
45
44
  }
46
- (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
47
- event_category: "Uniform Personalization",
48
- event_label: result.variantIds.join(", "),
49
- is_control_group: result.control ? 1 : 0
45
+ result.variantIds.forEach((variant) => {
46
+ var _a;
47
+ (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
48
+ event_category: "Uniform Personalization",
49
+ event_label: variant.id,
50
+ is_control_group: result.control || variant.control ? 1 : 0
51
+ });
50
52
  });
51
53
  };
52
54
  const onTestResult = (result) => {
package/dist/index.mjs CHANGED
@@ -11,7 +11,6 @@ var enableGoogleGtagAnalytics = (options) => {
11
11
  return {
12
12
  init: (context) => {
13
13
  const onPersonalizationResult = (result) => {
14
- var _a;
15
14
  if (!isGtagConfigured()) {
16
15
  context.log("warn", 700);
17
16
  return;
@@ -19,10 +18,13 @@ var enableGoogleGtagAnalytics = (options) => {
19
18
  if (!emitAll && !result.changed) {
20
19
  return;
21
20
  }
22
- (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
23
- event_category: "Uniform Personalization",
24
- event_label: result.variantIds.join(", "),
25
- is_control_group: result.control ? 1 : 0
21
+ result.variantIds.forEach((variant) => {
22
+ var _a;
23
+ (_a = theWindow.gtag) == null ? void 0 : _a.call(theWindow, "event", result.name, {
24
+ event_category: "Uniform Personalization",
25
+ event_label: variant.id,
26
+ is_control_group: result.control || variant.control ? 1 : 0
27
+ });
26
28
  });
27
29
  };
28
30
  const onTestResult = (result) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context-gtag",
3
- "version": "19.131.1-alpha.8+d326c2787d",
3
+ "version": "19.133.0",
4
4
  "description": "Uniform Context Google global site tag analytics package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "@types/gtag.js": "0.0.18"
31
31
  },
32
32
  "dependencies": {
33
- "@uniformdev/context": "19.131.1-alpha.8+d326c2787d"
33
+ "@uniformdev/context": "19.133.0"
34
34
  },
35
35
  "files": [
36
36
  "/dist"
@@ -38,5 +38,5 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  },
41
- "gitHead": "d326c2787d0b159fcd7edb45b165a8eae54862e6"
41
+ "gitHead": "405a628b0f592ca13bf65006ef5c92261468c144"
42
42
  }