Merged in hotfix/2025-10-06-remove-amplitude (pull request #2613)
Hotfix/2025 10 06 remove amplitude
This commit is contained in:
@@ -4,7 +4,7 @@ import { getAuth, updatePassword, updateProfile } from "@firebase/auth";
|
|||||||
import { getFirestore } from "@firebase/firestore";
|
import { getFirestore } from "@firebase/firestore";
|
||||||
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import * as amplitude from '@amplitude/analytics-browser';
|
//import * as amplitude from '@amplitude/analytics-browser';
|
||||||
import posthog from 'posthog-js'
|
import posthog from 'posthog-js'
|
||||||
|
|
||||||
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
||||||
@@ -91,14 +91,14 @@ export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
|||||||
// dbevent: false,
|
// dbevent: false,
|
||||||
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
||||||
// });
|
// });
|
||||||
console.log(
|
// console.log(
|
||||||
"%c[Analytics]",
|
// "%c[Analytics]",
|
||||||
"background-color: green ;font-weight:bold;",
|
// "background-color: green ;font-weight:bold;",
|
||||||
eventName,
|
// eventName,
|
||||||
eventParams
|
// eventParams
|
||||||
);
|
// );
|
||||||
logEvent(analytics, eventName, eventParams);
|
logEvent(analytics, eventName, eventParams);
|
||||||
amplitude.track(eventName, eventParams);
|
//amplitude.track(eventName, eventParams);
|
||||||
posthog.capture(eventName, eventParams);
|
posthog.capture(eventName, eventParams);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
|
|||||||
import reportWebVitals from "./reportWebVitals";
|
import reportWebVitals from "./reportWebVitals";
|
||||||
import "./translations/i18n";
|
import "./translations/i18n";
|
||||||
import "./utils/CleanAxios";
|
import "./utils/CleanAxios";
|
||||||
import * as amplitude from "@amplitude/analytics-browser";
|
//import * as amplitude from "@amplitude/analytics-browser";
|
||||||
import { PostHogProvider } from "posthog-js/react";
|
import { PostHogProvider } from "posthog-js/react";
|
||||||
import posthog from "posthog-js";
|
import posthog from "posthog-js";
|
||||||
|
|
||||||
@@ -26,23 +26,23 @@ registerSW({ immediate: true });
|
|||||||
// Dinero.globalLocale = "en-CA";
|
// Dinero.globalLocale = "en-CA";
|
||||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||||
|
|
||||||
amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
// amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
||||||
defaultTracking: true,
|
// defaultTracking: true,
|
||||||
serverUrl: import.meta.env.VITE_APP_AMP_URL
|
// serverUrl: import.meta.env.VITE_APP_AMP_URL
|
||||||
// {
|
// // {
|
||||||
// attribution: {
|
// // attribution: {
|
||||||
// excludeReferrers: true,
|
// // excludeReferrers: true,
|
||||||
// initialEmptyValue: true,
|
// // initialEmptyValue: true,
|
||||||
// resetSessionOnNewCampaign: true,
|
// // resetSessionOnNewCampaign: true,
|
||||||
// },
|
// // },
|
||||||
// fileDownloads: true,
|
// // fileDownloads: true,
|
||||||
// formInteractions: true,
|
// // formInteractions: true,
|
||||||
// pageViews: {
|
// // pageViews: {
|
||||||
// trackHistoryChanges: 'all'
|
// // trackHistoryChanges: 'all'
|
||||||
// },
|
// // },
|
||||||
// sessions: true
|
// // sessions: true
|
||||||
// }
|
// // }
|
||||||
});
|
// });
|
||||||
|
|
||||||
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||||
autocapture: false,
|
autocapture: false,
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import {
|
|||||||
validatePasswordResetSuccess
|
validatePasswordResetSuccess
|
||||||
} from "./user.actions";
|
} from "./user.actions";
|
||||||
import UserActionTypes from "./user.types";
|
import UserActionTypes from "./user.types";
|
||||||
import * as amplitude from '@amplitude/analytics-browser';
|
//import * as amplitude from '@amplitude/analytics-browser';
|
||||||
import posthog from 'posthog-js';
|
import posthog from 'posthog-js';
|
||||||
|
|
||||||
const fpPromise = FingerprintJS.load();
|
const fpPromise = FingerprintJS.load();
|
||||||
@@ -92,7 +92,7 @@ export function* isUserAuthenticated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogRocket.identify(user.email);
|
LogRocket.identify(user.email);
|
||||||
amplitude.setUserId(user.email);
|
//amplitude.setUserId(user.email);
|
||||||
posthog.identify(user.email);
|
posthog.identify(user.email);
|
||||||
|
|
||||||
const eulaQuery = yield client.query({
|
const eulaQuery = yield client.query({
|
||||||
@@ -139,7 +139,7 @@ export function* signOutStart() {
|
|||||||
imexshopid: state.user.bodyshop.imexshopid,
|
imexshopid: state.user.bodyshop.imexshopid,
|
||||||
type: "messaging"
|
type: "messaging"
|
||||||
});
|
});
|
||||||
amplitude.reset();
|
//amplitude.reset();
|
||||||
} catch {
|
} catch {
|
||||||
console.log("No FCM token. Skipping unsubscribe.");
|
console.log("No FCM token. Skipping unsubscribe.");
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amplitude.setGroup('Shop', payload.shopname);
|
//amplitude.setGroup('Shop', payload.shopname);
|
||||||
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
||||||
if (authRecord[0] && authRecord[0].user.validemail) {
|
if (authRecord[0] && authRecord[0].user.validemail) {
|
||||||
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
||||||
|
|||||||
Reference in New Issue
Block a user