I am just about to add the event code a button that downloads the PDF.

Event code fields:

_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)

Example of event code:

onClick="_gaq.push(['_trackEvent', 'Videos', 'Play', 'Baby\'s First Birthday']);"

I was just wondering if anyone knows if there is a text limit on the opt_value?

Do you think the following would be too long 'Elmhurst School says IPC has made all the difference'?

2 Answers 2


Google's event tracking guide doesn't list a limit on those fields http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html

A blog post suggests its 46 characters which may also be the limit for event tracking variables http://www.testically.org/2011/11/22/google-analytics-_setcustomvar-values-have-a-character-limit/

This will work:

_gaq.push(['_setCustomVar', 1, 'var_key', '1234567890123456789012345678901234567890123456', 3]);

While this doesn’t:

_gaq.push(['_setCustomVar', 1, 'var_key', '12345678901234567890123456789012345678901234567890', 3]);
  • Ok great thanks Anagio... so basic rule of thumb is to keep it short if possible... just read that you cant change this info at a later date, so best to get it right first time!
    – Theo G
    Mar 8, 2012 at 14:00
  • Yes keep them short, abbreviate when possible. They work to organize your events categorically. So if your button for the Elmhurst School says IP... is located say in the header or top area of your site is is shown on all pages you could have 'Site wide', 'Header', 'IPC Button' or similar
    – Anagio
    Mar 8, 2012 at 22:41
  • You can also look at the AdWords URL builder this creates the extra parameters for links so that when a link is clicked to or within your site it makes entries into a campaign within Analytics support.google.com/googleanalytics/bin/…
    – Anagio
    Mar 8, 2012 at 22:45
  • nice one... will have a look into that one. Thanks Anagio
    – Theo G
    Mar 9, 2012 at 15:13

opt_value should actually be an integer not a string. Although other char limit answers apply to the string values. e.g. action, opt_label.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.