问题
I am using Google Analytics for tracking events in my Android App. My question is: is there a limit for the string length in an event? I have found nothing about this topic on Googles devguide site.
Best regards!
Edit: I tried it whith a string with 2000 characters - and it works. If you need more (I don't believe), than try it first.
回答1:
According to the official documentation,
- Max Length for Event Category = 150 Bytes
- Max Length for Event Action = 500 Bytes
- Max Length for Event Label = 500 Bytes
- For all other parameters, you can check in the same page.
Long text is automatically truncated according to this doc:
If any of the values are greater than the maximum lengths, they will automatically be truncated. If a multi-byte character exceeds the maximum length, the entire character will be truncated.
回答2:
Note that Google Analytics will give a 414 error and tell you that your string is too long, when in fact you've sent a malformed string. Just take a modest string and insert a few spaces to see for yourself.
回答3:
The maximum event label string length is 2048 bytes: https://developers.google.com/analytics/devguides/collection/protocol/v1/reference#maxlength
来源:https://stackoverflow.com/questions/12280993/google-analytics-event-tracking-max-string-length