randalv
randalv

Reputation: 918

Use client-side Google analytics to log server-side Django events

Does anyone have any best practice recommendations for using client side Google Analytics to log server side-triggered Django events? There are particularly granular server side events that I wish to log to GA from my Django webapp.

I am already using the Django messages framework for user-facing messages, so I am hesitant to overload it by trying to queue up GA messages that then get logged on the next user-facing page. I could use session variables to do the same sort of thing, but that also feels somewhat cloogy. I'd rather implement a server-side call but there's no elegant solution there either, so I may as well stick to the standard GA APIs.

Has anyone cascaded server-side events forward to the client Google Analytics logging using Django/Python or another web framework, and what do you recommend?

Upvotes: 1

Views: 1004

Answers (1)

Erik Näslund
Erik Näslund

Reputation: 1376

GA has a pretty nice upcoming feature called the Measurement Protocol. It allows you to push data from server side using simple POST requests. It is still at a developer preview stage, but you can request access to try it out.

Upvotes: 2

Related Questions