Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

FEAT: Marketing Related Integration (#449)

Tahier Hussain8a1c2320d77d
diff --git a/backend/account/authentication_controller.py b/backend/account/authentication_controller.py
index de0734cee..72dcce79e 100644
--- a/backend/account/authentication_controller.py
+++ b/backend/account/authentication_controller.py
@@ -209,6 +209,7 @@ class AuthenticationController:
response: Response = Response(
status=status.HTTP_200_OK,
data={
+ "is_new_org": new_organization,
"user": serialized_user_info,
"organization": organization_info,
f"{Common.LOG_EVENTS_ID}": StateStore.get(Common.LOG_EVENTS_ID),
diff --git a/frontend/src/hooks/useSessionValid.js b/frontend/src/hooks/useSessionValid.js
index f448d8177..16fcf754b 100644
--- a/frontend/src/hooks/useSessionValid.js
+++ b/frontend/src/hooks/useSessionValid.js
@@ -18,11 +18,21 @@ try {
// Plugin not available
}
+// Import useGoogleTagManager hook
+let hsSignupEvent;
+try {
+ hsSignupEvent =
+ require("../plugins/hooks/useGoogleTagManager.js").useGoogleTagManager();
+} catch {
+ // Ignore if hook not available
+}
+
function useSessionValid() {
const setSessionDetails = useSessionStore((state) => state.setSessionDetails);
const handleException = useExceptionHandler();
const navigate = useNavigate();
const userSession = useUserSession();
+
return async () => {
try {
const userSessionData = await userSession();
@@ -58,6 +68,12 @@ function useSessionValid() {
window.location.reload();
}
});
+
+ const isNewOrg = setOrgRes?.data?.is_new_org || false;
+ if (isNewOrg && hsSignupEvent) {
+ hsSignupEvent();
+ }
+
userAndOrgDetails = setOrgRes?.data?.user;
userAndOrgDetails["orgName"] = setOrgRes?.data?.organization?.name;
userAndOrgDetails["orgId"] = orgId;