From 8d7d33393d49ff20e479f1bc00de2ceea1d53c44 Mon Sep 17 00:00:00 2001 From: Vishal Sharma Date: Thu, 10 Apr 2025 15:17:14 +0530 Subject: [PATCH] feat: include tenant_url in event attributes for logging (#7582) --- frontend/src/api/common/logEvent.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/api/common/logEvent.ts b/frontend/src/api/common/logEvent.ts index 26c7807bd9..fd09002582 100644 --- a/frontend/src/api/common/logEvent.ts +++ b/frontend/src/api/common/logEvent.ts @@ -11,9 +11,12 @@ const logEvent = async ( rateLimited?: boolean, ): Promise | ErrorResponse> => { try { + // add tenant_url to attributes + const { hostname } = window.location; + const updatedAttributes = { ...attributes, tenant_url: hostname }; const response = await axios.post('/event', { eventName, - attributes, + attributes: updatedAttributes, eventType: eventType || 'track', rateLimited: rateLimited || false, // TODO: Update this once we have a proper way to handle rate limiting });