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

@@ -11,6 +11,7 @@ import { UPDATE_JOB } from "../../../../graphql/jobs.queries";
import { selectBodyshop } from "../../../../redux/user/user.selectors";
import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component";
import ConfigFormComponents from "../../../config-form-components/config-form-components.component";
import { logImEXEvent } from "../../../../firebase/firebase.utils";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -29,6 +30,7 @@ export function JobIntakeForm({ formItems, bodyshop }) {
const handleFinish = async (values) => {
console.log("values", values);
logImEXEvent("job_complete_intake");
const result = await intakeJob({
variables: {

View File

@@ -9,6 +9,7 @@ import { selectBodyshop } from "../../../../redux/user/user.selectors";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../../../firebase/firebase.utils";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
@@ -21,7 +22,10 @@ const mapDispatchToProps = (dispatch) => ({
export function JobIntakeTemplateList({ bodyshop, templates }) {
const { jobId } = useParams();
const { t } = useTranslation();
//TODO SHould this be using the generic one?
const renderTemplate = async (templateKey) => {
logImEXEvent("job_intake_template_render");
const html = await RenderTemplate(
{
name: templateKey,
@@ -33,6 +37,8 @@ export function JobIntakeTemplateList({ bodyshop, templates }) {
};
const renderAllTemplates = () => {
logImEXEvent("job_intake_render_all_templates");
templates.forEach((template) => renderTemplate(template));
};