Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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'?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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]);
share|improve this answer
    
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 '12 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 '12 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 '12 at 22:45
    
nice one... will have a look into that one. Thanks Anagio –  Theo G Mar 9 '12 at 15:13
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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