Search code examples
google-analyticsgtag.js

Gtag Event Parameter not passing complete data


gtag('event', <action>, {
  'event_category': <category>,
  'event_label': <label>,
  'value': <value>
});

sends an event with an action of '"clickevent on username : [email protected]"', a category of 'bbb', and a label of 'ccc':

but event got only 40 characters of action i.e("clickevent on username : firstName.lastN") Is their any limitation to gtag event action?

gtag('clickevent on username : [email protected]', {
  'event_category' : 'bbb',
  'event_label' : 'ccc'
});

Solution

  • Event action limit is 500 bytes, so more then 40 characters: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ea

    Anyway, you shouldn't pass personal information (such as an email address) to Analytics. Google may delete your account and all your data.

    The fact that the string is truncated is strange, check that in your system there is no control on the PII (in this case the email) put just to avoid sending this personal information.