Download - Using Custom Variables in Google Analytics
CardinalPath.com
Using Custom Variables with Google Analytics
Adrian VenderSEO Manager & Analytics Consultant
@adrianvender
CardinalPath.com
Who Are We?
CardinalPath.com
Who lovesAnalytics?
CardinalPath.com
How You See Analytics
Don’t love Love
CardinalPath.com
Hipster dog says…
CardinalPath.com
Dimensions
CardinalPath.com
setCustomVar_setCustomVar(index, name, value, opt_scope)
• index—The slot for the custom variable. (range from: 1 – 5)• name—Key (string)• value—Value (string)• opt_scope—Scope: 1 (visitor-level), 2 (session-level), or 3 (page-
level). Default = 1
pageTracker._setCustomVar( 5, // This custom var is set to slot #5”Added Item to Cart", // The name acts as a category for the user activity "Yes", // This value of the custom variable 2 // Sets the scope to session-level );
CardinalPath.com
Understanding Scope
Visitor
Visits
Pageviews
Hometown=Austin,TX
CardinalPath.com
Slot/Scope RestrictionsDuration When sharing a slot
with other variablesNumber allowed
Page‐level A single pageview, event, or transaction call.
The last page‐level variable to be called on a page is the one applied to that page.
For any web property, many unique page‐level variables can be set and slots can be re‐used. Limited only by the number of hits in a given session.For any single page, you can set up to 5 simultaneous custom variables.
Session‐level The current session of the visitor.
The last session‐level variable called in a session is the one used for that session.
For any web property, you can create as many distinct session‐level custom variables as can be defined with a 64‐byte key‐value pair limit.For any given user session, you can set up to 5 session‐level variables.
Visitor‐level The current session and all future sessions for the life of the visitor cookie.
The last value set for a visitor is the one applied to the current and future sessions.
For any web property, you can create up to five distinct visitor‐level variables.
http://cutroni.com/blog/2011/05/18/mastering‐google‐analytics‐custom‐variables/Need more help?
CardinalPath.com
Sending Custom Variables‘Set’ a custom variable with _setCustomVar(), ‘send’ using a
tracking GIF request.
Tip: Send events instead of Page-level vars if possible(you can still segment by events!)
<script>_gaq.push([‘_setCustomVar’,1,’userType’,’Member’,2]);………_gaq.push([‘_trackEvent’,’memberAction’,’login’]);</script>
CardinalPath.com
Character LimitsThe sum of the name-value pair of a custom variable must not
exceed 64 bytes.
Example 1: “userType”:”member”8 + 6 = 14 bytes
Example 2: “Hometown”:”Phoenix, AZ”8 + 11 = 19 bytes(*spaces and special characters each use a byte too!)
CardinalPath.com
Custom Var Reports… meh
CardinalPath.com
Advanced Segments. #win!
CardinalPath.com
Members vs Non-members
<script type="text/javascript">_gaq.push(['_setCustomVar',1,'Visitor_Type','Member',1]);</script>
CardinalPath.com
Membership Types
<script type="text/javascript">_gaq.push(['_setCustomVar’,2,'Member_Level',’Silver',1]);</script>
<script type="text/javascript">_gaq.push(['_setCustomVar',2,'Member_Level','Gold',1]);</script>
<script type="text/javascript">_gaq.push(['_setCustomVar',2,'Member_Level',’Platinum',1]);</script>
CardinalPath.com
Logged In?
<script type="text/javascript">_gaq.push(['_setCustomVar',3,'Member_Status','Logged_In',2]);</script>
CardinalPath.com
Demographics
CardinalPath.com
<form onsubmit="_gaq.push(['_setCustomVar',1,'Gender',this.gender.options[this.gender.selectedIndex].value,3);"><select name="gender"><option value="Female">Female</option><option value="Male">Male</option></select>
CardinalPath.com
Coupon Code
CardinalPath.com
Previous Purchase?
<script type="text/javascript">_gaq.push(['_setCustomVar',3,'Member_Status',’purchased',2]);</script>
CardinalPath.com
Author: Jalen Rose Topic: Sports
Type: Blog
Geo: USA
CardinalPath.com
Google Analytics integration -Multivariate
//Begin GA‐GWO integration Codeif(typeof(utmx) !== 'undefined') { var comboNum=utmx('combination');comboVal="combo"+comboNum;pageTracker._setCustomVar(2,"combo",comboVal,2);
}//End GA‐GWO integration Code
CardinalPath.com
Google Analytics integration
CardinalPath.com
Google Analytics integration – MVT
• Advanced Segments
CardinalPath.com
Search intent and user demographics
CardinalPath.com
Retaining original search term
CardinalPath.com
Retaining original search term
CardinalPath.com
Facebook Demographics
Do NOT store Personal Identifiable Information (PII)!
CardinalPath.com
Facebook Demographics
http://goo.gl/BlCMD
CardinalPath.com
Segmentation magic
CardinalPath.com
CardinalPath.com
Shout outs
CardinalPath.com
Thank you!@adrianvender