The core point of this problem is related to that a client might use some systems which will integrate a little bit later after javascript evaluation. (F.e. smth like Google Tag Manager or similar). In that situation, simply get of the page isn't going to work. I tried Puppeteer and Phantom techs which works with Chrome Headless feature but it's hard to deploy them. Maybe someone has some more neat idea?
Is your script sending any events to your app? How about track the events coming in? With very little info you provided it is hard to suggest anything tbh.
My gosh, that's a perfect idea. I think I can even create an init event for my system. Thank you so much :)
If the event way won't work you could try:
Anyway, init event should be the simplest solution
Thanks for additional info! I will keep in mind it. Really happy to see how supportive this community :)