We want to track URL changes and different events in our Angular (v5.1) application.
We need to receive the collected data to our own server, and not to one of the supported providers (like Google Analytics).
It seems that Angulartics2 supports a lot of providers and also have the ability for writing a custom provider. As they write in their website: "If there's no Angulartics2 plugin for your analytics vendor of choice, please feel free to write yours".
I don't find any documentation for how to write a custom provider. If anyone has any experience with that.
Or any recommendation for another analytics library that works with Angular and can send data to a custom URL.
Thanks.
same Question here... found Solution to share: (First Stackoverflow contribution, excuse form issues)
I've looked at this one cause its quite simple.
declare var _kmq: any;
and inject your own ApiService instead.I've removed
this.angulartics2.setUsername
andthis.angulartics2.setUserProperties
from constructor. Cause I don't know what it is used for... My backend Team provided an endpoint which awaits following data structure:My Analytics Actions so far:
Then this would be my ApiService:
And last but not least my CustomProvider:
Then just follow normal installation instructions
import Angulartic2Module to AppModule:
inject your custom provider service to AppComponent and start tracking:
The rest should be default...