mod-build 3.7.26 → 3.7.27

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.27
4
+
5
+ - Adding VWO variation ID to the body tag as an attribute `data-vwo-test-id`.
6
+
3
7
  ## 3.7.26
4
8
 
5
9
  - Added jacuzzi in the sites that should have tcpa below the cta.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.7.26",
3
+ "version": "3.7.27",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -10,6 +10,12 @@ window.VWO.push(['onEventReceive', 'vA', function (data) {
10
10
  n: variationName
11
11
  }
12
12
  }
13
+ if (variationId != 1 && window.addVwoTestAttribute) {
14
+ // Control is assigned variation ID 1 - variations receive incremented IDs starting from 2
15
+ const adjustedVariationId = variationId - 1;
16
+ const vwoTestAttrValue = `${experimentId}-${adjustedVariationId}`;
17
+ document.body.setAttribute('data-vwo-test', vwoTestAttrValue);
18
+ }
13
19
  }
14
20
  }]);
15
21