How can I implement analytics.js to my page and send the tracking methods to my own backend

35 Views Asked by At

Is it possible to handle the analytics.js library to send the events to my own backend instead of going through configured third party plugins? Or is there any way to implement a plugin with my own api, so it will send to my backend?

I tried importing analytics.js to my index.html and follow some instructions from the documentation, but to load the library, it says analytics.load('YOUR_KEY'), but for my case, I don´t think if this YOUR_KEY is necessary, since I would not like to implement a plugin.

1

There are 1 best solutions below

0
BNazaruk On

First of all, I believe analytics.js is the legacy GA library. It does not support custom endpoints for tracking.

Try Matomo. It's open source and supports you hosting analytics on your own backend.