Added first round of analytics and event tracking BOD-190

This commit is contained in:
Patrick Fic
2020-07-17 08:27:28 -07:00
parent 3f0394760a
commit a54a85b96c
73 changed files with 433 additions and 208 deletions

View File

@@ -19,6 +19,7 @@ import RenderTemplate, {
displayTemplateInWindow,
} from "../../utils/RenderTemplate";
import { setEmailOptions } from "../../redux/email/email.actions";
import { logImEXEvent } from "../../firebase/firebase.utils";
const mapStateToProps = createStructuredSelector({
paymentModal: selectPayment,
@@ -69,6 +70,8 @@ function InvoiceEnterModalContainer({
try {
let stripePayment;
if (useStripe && bodyshop.stripe_acct_id) {
logImEXEvent("payment_stripe_attempt");
const secretKey = await axios.post("/stripe/payment", {
amount: Math.round(values.amount * 100),
stripe_acct_id: bodyshop.stripe_acct_id,
@@ -94,6 +97,7 @@ function InvoiceEnterModalContainer({
throw new Error();
}
}
logImEXEvent("payment_insert");
const newPayment = await insertPayment({
variables: {
@@ -168,15 +172,13 @@ function InvoiceEnterModalContainer({
okButtonProps={{
loading: loading,
}}
destroyOnClose
>
destroyOnClose>
<Form
onFinish={handleFinish}
autoComplete={"off"}
form={form}
layout="vertical"
initialValues={{ jobid: context.jobId }}
>
layout='vertical'
initialValues={{ jobid: context.jobId }}>
<PaymentForm form={form} stripeStateArr={stripeStateArr} />
</Form>
</Modal>