How to match server tracker unstructured events with client tracker ones

Currently we have a need to generate some unstructured events at server side for a backend service that is used by a front end client web app. So far we only had events tracked with js tracker, which generates web_page_id context and we use it to match all unstructured events originating from single page view.
The problem is that if we track additional events on server side, that we want to match back to the same page view there is no unique identifier to do this. As I understand the only option is to use some custom request_id which is generated on service or front-end and gets passed to both server and js tracker, then we could use that context for additional matching.
Just want to know if this is the right approach or maybe there is a cleaner way to consolidate multiple trackers for single page view?

Any comments welcome!

1 Like

Yes that’s a good approach: generate a custom HTTP request context in your back-end service, send it with the back-end events and then also render it into your front-end HTML so that the front-end tracking code and pick it up and sent it too.

It has the downside of making cache much harder, which could impact performance, right?

@alex thanks for the update.
@bernardosrulzon what kind of cache do you have in mind? If it’s for the service output than yes, you would have to call the service every time, but that’s unavoidable in any case for us as we want to track every call.