Skip to content

Commit

Permalink
Merge pull request #64 from nomasi/master
Browse files Browse the repository at this point in the history
Events for the new UI added
  • Loading branch information
tjjalava authored Aug 1, 2017
2 parents f3a2d49 + 1cebd73 commit 8005938
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/SizeMeApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class SizeMeApp extends React.Component {
getProduct()
]).then(([tokenResolved, productResolved]) => {
if (tokenResolved && productResolved) {
trackEvent("productPageLoggedIn", "Store: Product page load, logged in");
trackEvent("productPageLoggedIn", "Store: Product page load, SM product, logged in");
} else if (tokenResolved && !productResolved) {
trackEvent("productPageNonSMLoggedIn", "Store: Product page load, logged in");
trackEvent("productPageNonSMLoggedIn", "Store: Product page load, Non-SM product, logged in");
} else if (!tokenResolved && productResolved) {
trackEvent("productPageLoggedOut", "Store: Product page load, logged out");
trackEvent("productPageLoggedOut", "Store: Product page load, SM product, logged out");
} else {
trackEvent("productPageNonSMLoggedOut", "Store: Product page load, logged out");
trackEvent("productPageNonSMLoggedOut", "Store: Product page load, Non-SM product, logged out");
}
setSelectedProfile();
});
Expand Down
2 changes: 2 additions & 0 deletions src/api/SizeSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ class AbstractSelect {
setSelected = val => {
if (this.selectors[val]) {
this.selectors[val]();
trackEvent("sizeRecommended", "Store: Recommended a size based on user input");
} else {
this.clearSelection();
selectSize("");
trackEvent("sizeCantRecommend", "Store: We couldnt find a size based on user input");
}
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/common/MeasurementInput.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import PropTypes from "prop-types";
import ReactTooltip from "react-tooltip";
import { trackEvent } from "../api/ga";

const unitMarks = {
cm: "cm",
Expand Down Expand Up @@ -97,6 +98,7 @@ class MeasurementInput extends React.Component {
this.setState(state, () => {
if (doDispatch) {
this.props.onChange(modelValue);
trackEvent("measurementEntered", "Store: Measurement entered or changed in input field");
}
});
}
Expand Down
1 change: 0 additions & 1 deletion src/common/SignupBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "./SignupBox.scss";
import validator from "validator";
import { translate } from "react-i18next";


class SignupBox extends React.Component {
constructor (props) {
super(props);
Expand Down
2 changes: 2 additions & 0 deletions src/common/SizeForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import OverlapBox from "../illustrations/OverlapBox";
import "./SizeForm.scss";
import { translate } from "react-i18next";
import { setTooltip } from "../api/actions";
import { trackEvent } from "../api/ga";

class SizeForm extends React.Component {

Expand Down Expand Up @@ -59,6 +60,7 @@ class SizeForm extends React.Component {

openGuideModal = () => {
this.setState({ guideModalOpen: true });
trackEvent("measurementGuideOpened", "Store: Measurement guide modal clicked");
};

closeGuideModal = () => {
Expand Down

0 comments on commit 8005938

Please sign in to comment.