Every time that these methods are called:
this.visitor.pageview
this.visitor.events
this.visitor.transaction
The plugin calls the method .send()
immediately. That is an async call. Because of that, some hits might get to google analytics and others not.So, my suggestion is, when the app is about to send the response back to the platform, the plugin should call the method .send()
and the universal-analytics
package will send all the events logged during the request. So, there’s no need to send it individually every time. Instead, we can send them all at once at the end of the request