Skip to content

Commit fd6d93d

Browse files
jethronPaul Boocock
authored andcommitted
Fix OptimizelyX context collecting (close #730)
The global vars seem to be confusing the minifier in some way in newer builds, and the uglified code throws an exception trying to assign to an undefined variable, which results in the events being discarded. Making the variables local resolves the issue.
1 parent 7d4eb8a commit fd6d93d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/js/tracker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,10 @@
11161116
var visitor = getOptimizelyXData('visitor');
11171117

11181118
return map(experiment_ids, function(activeExperiment) {
1119-
variation = state.getVariationMap()[activeExperiment];
1120-
variationName = variation.name;
1121-
variationId = variation.id;
1122-
visitorId = visitor.visitorId;
1119+
var variation = state.getVariationMap()[activeExperiment];
1120+
var variationName = variation.name;
1121+
var variationId = variation.id;
1122+
var visitorId = visitor.visitorId;
11231123
return {
11241124
experimentId: parseInt(activeExperiment),
11251125
variationName: variationName,

0 commit comments

Comments
 (0)