Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Using Custom Variables in Google Analytics


Published on

Published in: Technology, Business

Using Custom Variables in Google Analytics

  1. 1. Using Custom Variableswith Google AnalyticsAdrian VenderSEO Manager & Analytics Consultant@adrianvender
  2. 2. Who Are We?
  3. 3. Who lovesAnalytics?
  4. 4. How You See AnalyticsDon’t love Love
  5. 5. Hipster dog says…
  6. 6. Dimensions
  7. 7. 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 = 1pageTracker._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 );
  8. 8. Understanding Scope Hometown=Austin,TX VisitorVisits Pageviews
  9. 9. Slot/Scope Restrictions Duration When sharing a slot  Number allowed with other variablesPage‐level A single pageview,  The last page‐level  For any web property, many unique page‐ event, or transaction  variable to be called  level variables can be set and slots can be  call. on a page is the one  re‐used. Limited only by the number of hits  applied to that page. in a given session. For any single page, you can set up to 5  simultaneous custom variables.Session‐level The current session of  The last session‐level  For any web property, you can create as  the visitor. variable called in a  many distinct session‐level custom  session is the one  variables as can be defined with a 64‐byte  used for that session. key‐value pair limit. For any given user session, you can set up  to 5 session‐level variables.Visitor‐level The current session and  The last value set for  For any web property, you can create up to  all future sessions for  a visitor is the one  five distinct visitor‐level variables. the life of the visitor  applied to the current  cookie. and future sessions. Need more help?‐google‐analytics‐custom‐variables/
  10. 10. Sending Custom Variables‘Set’ a custom variable with _setCustomVar(), ‘send’ using a tracking GIF request.<script>_gaq.push([‘_setCustomVar’,1,’userType’,’Member’,2]);………_gaq.push([‘_trackEvent’,’memberAction’,’login’]);</script>Tip: Send events instead of Page-level vars if possible(you can still segment by events!)
  11. 11. Character LimitsThe sum of the name-value pair of a custom variable must not exceed 64 bytes.Example 1: “userType”:”member”8 + 6 = 14 bytesExample 2: “Hometown”:”Phoenix, AZ”8 + 11 = 19 bytes(*spaces and special characters each use a byte too!)
  12. 12. Custom Var Reports… meh
  13. 13. Advanced Segments. #win!
  14. 14. Members vs Non-members <script type="text/javascript"> _gaq.push([_setCustomVar,1,Vi sitor_Type,Member,1]); </script>
  15. 15. 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>
  16. 16. Logged In?<script type="text/javascript">_gaq.push([_setCustomVar,3,Member_Status,Logged_In,2]);</script>
  17. 17. Demographics
  18. 18. <formonsubmit="_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>
  19. 19. Coupon Code
  20. 20. Previous Purchase?<script type="text/javascript">_gaq.push([_setCustomVar,3,Member_Status,’purchased,2]);</script>
  21. 21. Author: Jalen Rose Topic: Sports Type: Blog Geo: USA
  22. 22. Google Analytics integration - Multivariate //Begin GA‐GWO integration Code if(typeof(utmx) !== undefined) {  var comboNum=utmx(combination); comboVal="combo"+comboNum; pageTracker._setCustomVar(2,"combo",comboVal,2); } //End GA‐GWO integration Code
  23. 23. Google Analytics integration
  24. 24. Google Analytics integration – MVT• Advanced Segments
  25. 25. Search intent and user demographics
  26. 26. Retaining original search term
  27. 27. Retaining original search term
  28. 28. Facebook DemographicsDo NOT store Personal Identifiable Information (PII)!
  29. 29. Facebook Demographics
  30. 30. Segmentation magic
  31. 31.
  32. 32. Shout outs
  33. 33. Thank you! @adrianvender