So `dispatchEvent` alone didn't work for you but adding `trigger` on top of it did?
This is what I currently have:
In index.html
window.analyticsEvent = new Event('analytics');
In a react tsx file
React.useEffect(() => {
window.dispatchEvent(window.analyticsEvent);
}, [location.pathna...