feat: include tenant_url in event attributes for logging (#7582)

This commit is contained in:
Vishal Sharma 2025-04-10 15:17:14 +05:30 committed by GitHub
parent 8d143b44b1
commit 8d7d33393d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,9 +11,12 @@ const logEvent = async (
rateLimited?: boolean,
): Promise<SuccessResponse<EventSuccessPayloadProps> | 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
});