mod-build 4.0.58 → 4.0.59-beta.2

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
+ ## 4.0.59
4
+
5
+ - Adding VWO variation ID to the body tag as an attribute `data-vwo-test-id`
6
+
3
7
  ## 4.0.58
4
8
 
5
9
  - Upgraded to new vwo smart code
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.58",
3
+ "version": "4.0.59-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -10,6 +10,12 @@
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 actualVariationId = variationId - 1;
16
+ const vwoTestAttrValue = `${experimentId}-${actualVariationId}`;
17
+ document.body.setAttribute('data-vwo-test', vwoTestAttrValue);
18
+ }
13
19
  }
14
20
  }]);
15
21