mod-build 4.0.59-beta.6 → 4.0.59-beta.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/CHANGELOG.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  ## 4.0.59
4
4
 
5
- - Added jacuzzi in the sites that should have tcpa below the cta.
5
+ - Adding VWO variation ID to the body tag as an attribute `data-vwo-test-id`
6
6
 
7
7
  ## 4.0.58
8
8
 
9
- - Upgraded to new VWO smart code.
9
+ - Upgraded to new vwo smart code
10
10
 
11
11
  ## 4.0.57
12
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.59-beta.6",
3
+ "version": "4.0.59-beta.9",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -45,7 +45,6 @@ function handlebarsX(expression, context) {
45
45
  }
46
46
 
47
47
  const tradesWithTcpaAboveCta = ['HOME_SECURITY'];
48
- const sitesWithTcpaBelowCta = ['go.jacuzzi.com'];
49
48
 
50
49
  export const handlebarsHelpers = [
51
50
  // Run any js line
@@ -193,8 +192,7 @@ export const handlebarsHelpers = [
193
192
  return false;
194
193
  }
195
194
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
196
- const site = page.domain.toLowerCase();
197
- return (tradesWithTcpaAboveCta.includes(trade) || page.isBranded) && !sitesWithTcpaBelowCta.includes(site);
195
+ return tradesWithTcpaAboveCta.includes(trade) || page.isBranded;
198
196
  }
199
197
  },
200
198
  {
@@ -204,8 +202,7 @@ export const handlebarsHelpers = [
204
202
  return false;
205
203
  }
206
204
  const trade = page.primary_trade.replace(/\s+/g, '_').toUpperCase();
207
- const site = page.domain.toLowerCase();
208
- return (!tradesWithTcpaAboveCta.includes(trade) && !page.isBranded) || sitesWithTcpaBelowCta.includes(site);
205
+ return !tradesWithTcpaAboveCta.includes(trade) && !page.isBranded;
209
206
  }
210
207
  }
211
208
  ]
@@ -2,7 +2,8 @@
2
2
  window.VWO = window.VWO || [];
3
3
  window.VWO.push(['onEventReceive', 'vA', function (data) {
4
4
  var experimentId = data[1];
5
- var variationId = data[2];
5
+ var variationId = +data[2];
6
+ // add sentry log if variationId is NaN?
6
7
  var variationName = _vwo_exp[experimentId].comb_n[variationId];
7
8
  if (typeof(_vwo_exp[experimentId].comb_n[variationId]) !== 'undefined' && ['VISUAL_AB', 'VISUAL', 'SPLIT_URL','SURVEY'].indexOf(_vwo_exp[experimentId].type) > -1) {
8
9
  window._vwo_campaignData = {
@@ -10,6 +11,12 @@
10
11
  n: variationName
11
12
  }
12
13
  }
14
+ if (variationId !== 1 && window.addVwoTestAttribute) {
15
+ // Control is assigned variation ID 1 - variations receive incremented IDs starting from 2
16
+ const actualVariationId = variationId - 1;
17
+ const vwoTestAttrValue = `${experimentId}-${actualVariationId}`;
18
+ document.body.setAttribute('data-vwo-test', vwoTestAttrValue);
19
+ }
13
20
  }
14
21
  }]);
15
22