user2252365
user2252365

Reputation:

Maximum length of userid field in Universal Analytics

What is the maximum length of user id filed in Universal Analytic s tracking code that we can set ?

Upvotes: 2

Views: 995

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

The documentation does not state an maximum length for parameters. However there is a maximum length for the request to the Universal Analytics endpoint.

payload_data – [...] The body must include exactly 1 URI encoded payload and must be no longer than 8192 bytes.

This applies when you send the hit data via a POST Request using the Measurment Protocol (which is what UA uses). If you use the javascript tracking code the data is sent to a GET request and some browsers will send a lot less than 8000 bytes (at least older Versions of IE are limited to some 2000 characters).

Since a number of other parameters are sent with the request it's not possible to give a fixed maximum length. The JS tracking code sets at least protocol version, hit type, client id, location and title (if you send the request through the measurement protocol you can omit location and title) so the User id can take the number of characters that are left.

Upvotes: 3

Related Questions