Tracking User Events on Your Server: A Guide for Client Access Issues
i have dont access my client code but i have mine server access client1.mydomain.com , client2.mydomain.com can i able to set the user events and track on our hosted server and how what i have to use // Example using Express.js const express = require('express'); const app = express(); const bodyParser = require('body-parser'); // Middleware to parse JSON requests app.use(bodyParser.json()); // Sample endpoint to track events app.post('/api/track-event', (req, res) => { const { userId, eventName, properties } = req.body; // Here you can log the event to your database or analytics service console.log('Event tracked:', { userId, eventName, properties }); // Respond to the client res.status(200).send({ success: true }); }); // Start the server app.listen(3000, () => { console.log('Server running on port 3000'); }); is this optimised solution?