Skip to content

Commit

Permalink
Merge pull request #34 from torchbox/cookie-name-fix
Browse files Browse the repository at this point in the history
Fix tracking cookie name to be consistent with worker and backend
  • Loading branch information
KalobTaulien authored Jul 8, 2021
2 parents bc18eaf + 2322e06 commit 286af8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wagtail_ab_testing/static/wagtail_ab_testing/js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
if (window.wagtailAbTesting) {
// Register the user as a participant if they haven't registered yet
if (window.wagtailAbTesting.testId) {
var cookieName = 'abtesting-' + window.wagtailAbTesting.testId + '-version';
var cookieName = 'wagtail-ab-testing_' + window.wagtailAbTesting.testId + '_version';
if (!document.cookie.includes(cookieName)) {
fetch(
window.wagtailAbTesting.urls.registerParticipant,
Expand Down Expand Up @@ -88,7 +88,8 @@
}

goalsForEvent.forEach(function (testId) {
var version = getCookie('abtesting-' + testId + '-version');
var cookieName = 'wagtail-ab-testing_' + testId + '_version';
var version = getCookie(cookieName);

if (version) {
fetch(
Expand Down

0 comments on commit 286af8f

Please sign in to comment.