I need the following function to fire every time a user lands on my site (regardless of the URL) in order to track traffic. The site is in Angular2 (v7). I placed the following function early on in the angular execution stack (in app.component.ts's constructor), however it only executes about once every few minutes at maximum, regardless of page reloads and navigation from new tabs. All other functions in the constructor work perfectly fine every time. Please help me fire this function every time:
constructor(){
this.currentDateTest = Date.now().toString();
this.afs.collection(`Traffic`).doc(this.currentDateTest).ref.set({
date: this.currentDateTest,
landingAddress: this.landingAddress,
referrer: document.referrer,
usersMeta: 'test'
});
otherFunctions()
}