pythongoogle-analyticsuserid

python Google Analytics setUserId


When triggering server events to Google Analytics, I can set the user ID in various programming languages as described in the official docs: https://developers.google.com/analytics/devguides/collection/ga4/user-id?platform=apps#swift

However, it is not mentioned, nor can I find anywhere, how to do the same when you work with Python.

Anyone knows?


Solution

  • Google only shows how to set the user id for their SDKs/frameworks. Python is not something they have a supported framework for in this case. You should refer to the manual of the library you're using for it.

    If you're not using a library for sending events, but rather building the requests from scratch, you want to refer to the measurement protocol documentation.