How can I programmatically trigger Google Analytics events without a browser?

Background:

We do not receive web events (for example, SMS) to our server, it would be nice to track them through analytics.

I thought of several solutions, but am not completely satisfied with any of them.

  • Hack analytics URL and publish it from the server.

    Not sure if this will work as there are a lot of inexplicable variables in the url.

  • Use a Javascript library like Rhino to try using a ga.js script without a web request.

    Once again, not sure if this will work, the rhino does not support the Document, which is required by the script.

  • I was thinking about how to fire events from the server to the page, but, of course, this requires a server to work with the javascript engine.

Greetings

Jono

+3
3

, GA noscript, . , -?

0

I know that it's already 4 years late for me to answer this question, but I think that Google has released a useful tool here: https://developers.google.com/analytics/devguides/collection/protocol/v1/

+2
source

Source: https://habr.com/ru/post/1718976/


All Articles