Skip to content

Commit

Permalink
Merge pull request #3729 from webcompat/issue/3681/1
Browse files Browse the repository at this point in the history
Fixes #3681 - Remove analytics for the form wizard
  • Loading branch information
ksy36 authored Sep 12, 2022
2 parents 66b4176 + 79d5f20 commit e273807
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 31 deletions.
8 changes: 0 additions & 8 deletions webcompat/static/js/lib/issue-wizard-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import $ from "jquery";
import Mousetrap from "Mousetrap";
import { sendAnalyticsEvent } from "./wizard/analytics.js";

class Popup {
constructor() {
Expand Down Expand Up @@ -36,13 +35,6 @@ class Popup {
const popupModal = document.querySelector(
`[data-popup-modal="${popupTrigger}"]`
);
sendAnalyticsEvent(
// transform trigger into camelCase and send as our event
popupTrigger.replace(/-([a-z])/g, (match) => {
return match[1].toUpperCase();
}),
"click"
);
popupModal.classList.add("is--visible");
this.overlay.classList.add("is-blacked-out");
this.activeSlide = document.querySelector(".dot.active");
Expand Down
17 changes: 0 additions & 17 deletions webcompat/static/js/lib/wizard/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,3 @@ export const sendAnalyticsCS = (campaign, source) => {
});
}
};

const sendAnalyticsVpv = (label) => {
ga("set", "page", `/vpv-${label}`);
ga("send", "pageview");
};

export const sendAnalyticsEvent = (label, action = "step") => {
if (window.ga) {
ga("send", "event", {
eventCategory: "wizard",
eventAction: action,
eventLabel: label,
});

sendAnalyticsVpv(label);
}
};
2 changes: 0 additions & 2 deletions webcompat/static/js/lib/wizard/stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import notify from "./notify.js";
import { STEPS } from "./steps/index.js";
import { sendAnalyticsEvent } from "./analytics.js";

const hideStep = (id) => {
STEPS[id].module.hide();
Expand All @@ -14,7 +13,6 @@ const showStep = (message) => {
const { id, data } = message;
const step = STEPS[id];
step.module.show(data);
sendAnalyticsEvent(id);
};

const updateStep = (message) => {
Expand Down
2 changes: 0 additions & 2 deletions webcompat/static/js/lib/wizard/steps/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import $ from "jquery";
import { showContainer } from "../ui-utils.js";
import { uploadConsoleLogs } from "./upload-helper/console-logs-upload.js";
import { uploadImage } from "./upload-helper/image-upload.js";
import { sendAnalyticsEvent } from "../analytics.js";

const container = $(".step-container.step-submit");
const form = $("#js-ReportForm form");
Expand Down Expand Up @@ -45,7 +44,6 @@ const submitForm = function () {

const onFormSubmit = (event) => {
event.preventDefault();
sendAnalyticsEvent("success", "end");
disableSubmits();
showLoadingIndicator();
uploadConsoleLogs().always(() => uploadImage().then(submitForm));
Expand Down
2 changes: 0 additions & 2 deletions webcompat/static/js/lib/wizard/steps/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import notify from "../notify.js";
import { isUrlValid, isEmpty } from "../validation.js";
import { extractPrettyUrl } from "../utils.js";
import { showError, showSuccess, hideSuccess } from "../ui-utils.js";
import { sendAnalyticsEvent } from "../analytics.js";

const urlField = $("#url");
const nextStepButton = $(".next-url");
Expand Down Expand Up @@ -76,7 +75,6 @@ const setInitialInputState = () => {
initListeners();
updateDescription(urlField.val());
setInitialInputState();
sendAnalyticsEvent("url", "start");

export default {
//this method is called when url is prefilled via postMessage or GET request
Expand Down

0 comments on commit e273807

Please sign in to comment.