File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -260,11 +260,21 @@ exports.track = functions.https.onRequest(async (req, res) => {
260260 // Extract event name and userId, pass through all other properties
261261 const { event, userId, ...eventProperties } = req . body ;
262262
263- mixpanel . track ( event , {
263+ console . log ( 'Track request received:' , {
264+ event,
265+ userId,
266+ eventProperties
267+ } ) ;
268+
269+ const mixpanelData = {
264270 distinct_id : userId ,
265271 displayProductName : 'FireWeb' ,
266272 ...eventProperties , // Pass through all additional properties from frontend
267- } ) ;
273+ } ;
274+
275+ console . log ( 'Sending to Mixpanel:' , { event, properties : mixpanelData } ) ;
276+
277+ mixpanel . track ( event , mixpanelData ) ;
268278
269279 // Send a success response to prevent 502 Bad Gateway error
270280 res . status ( 200 ) . send ( 'Event tracked successfully' ) ;
You can’t perform that action at this time.
0 commit comments