Search code examples
google-analyticsgoogle-analytics-4

Maximum length of Custom Dimension value?


As the title says : What is the maximum length of a string that can be stored inside a custom dimension in google analytics?


Solution

  • So the maximum length of Custom Dimension value must not exceed 150 bytes.

    • If you are using plain test, it can be upto: 150 characters (best case)
    • Worst case: - 37 characters

    There are various tools to calculate the bytes out of Characters. One of it I found: https://mothereff.in/byte-counter

    enter image description here

    Reference: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#dimension


    Update - GA4 limitations

    • Events can have a maximum of 25 parameters.
    • Events can have a maximum of 25 user properties.
    • User property names must be 24 characters or fewer.
    • User property values must be 36 characters or fewer.
    • Parameter names (including item parameters) must be 40 characters or fewer, may only contain alpha-numeric characters and underscores, and must start with an alphabetic character.
    • Parameter values (including item parameter values) must be 100 characters or fewer.
    • The post body must be smaller than 130kB.

    Reference: https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=gtag#required_parameters