Skip to content

Commit

Permalink
Restricted growth experiment pings to only apply to users inside the …
Browse files Browse the repository at this point in the history
…experiment. (treatment and control)
  • Loading branch information
maxxcrawford committed Apr 27, 2020
1 parent 5524e76 commit 706063c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions public/js/fxa-analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ function sendRecommendationPings(ctaSelector) {
});
});

document.querySelectorAll(".ga-growth-ping").forEach((el) => {
el.addEventListener("click", async(e) => {
// Overwrite current event category for active OAuth buttons
if (el.dataset.eventCategory !== "fxa-oauth") {
el.dataset.eventCategory = "fxa-oauth";
}
await sendPing(el, "Click", el.dataset.eventLabel);
if (document.body.dataset.experiment) {
document.querySelectorAll(".ga-growth-ping").forEach((el) => {
el.addEventListener("click", async(e) => {
// Overwrite current event category for active OAuth buttons
if (el.dataset.eventCategory !== "fxa-oauth") {
el.dataset.eventCategory = "fxa-oauth";
}
await sendPing(el, "Click", el.dataset.eventLabel);
});
});
});
}
}
})();

0 comments on commit 706063c

Please sign in to comment.