Slides: goo.gl/TUHB1                    Implementing Google
Q&A: goo.gl/6ADXU	

                         Analytics
                                           Vinoaj Vijeyakumaar
                                       Senior Conversion Specialist,
gplus.to/vinoaj	

                        Google Southeast Asia
twitter.com/vinoaj #devfestKL	

conversionroom-japac.blogspot.com	

       Kuala Lumpur, 2011
Why measure?
http://www.flickr.com/photos/screenpunk/2787210951/
The Role of the Web Analyst

        Reporting	

          Actionable Insights	





                              http://www.flickr.com/photos/kire/797533507/sizes/o/in/photostream/
What does “Action” mean?


 Discovering new opportunities	

  (eg. New markets, hot trends, customer segments)	





                                                        Optimisation	

 Improving marketing strategies	

                      Maximising reach
       (eg. New markets, optimise messaging)	

                                                        of your apps and
                                                        delighting users	



 Enhancing the user experience	

     (eg. Compelling content, optimal user flows)
Agenda

• How GA Works
• Tracking
 –  Basics
 –  Event Tracking
 –  Custom Variables
 –  Social Interaction Tracking
 –  Campaign Variables
 –  Page Load Time Tracking
• Mobile Tracking
 –  WAP
 –  Android and iOS
• Tracking Other Platforms
How GA Works
google.com.my/analytics
GA Tracking Code (GATC)
Site & Application Reporting
Track Behaviour


                      Behaviour


 Entry                                                        Exit


                    Engagement
         Reports on 125+ standard metrics and dimensions	

                                                                     1
                                                                     0
The GA Async Tracking Code
            Look for _gaq stack
            and execute queued
            commands	

                                  HTML5:
                                  Execute script
                                  asynchronously	





     Dynamically
     load the ga.js
     tracking library	




                                                      1
                                                      1
How Google Analytics works
        1. Request--"Show me this            Website Server
               webpage"
 __utm.gif?
 utmwv=6.3&utmn=101027544&utmsr=1280x854&utm
 sc=32-bit&utmul=en&utmje=1&utmjv=1.5&utmfl=7.0
 r24&utmdt=My <html>
              <head>
              ...
                                          2. Serve page
 %20Website&utmhn=www.site.com&utmp=/
              ...


 index.html&utmac=UA-51244-4&utmcc=__utma
              User
 %3D117945243.823564440.1131054947.1131080858.1
                                        3. Request: ga.js

 133834608.4%3B+__utmb%3D117945243%3B
              </head>
              <html>
 5. Call trackPageview()
              ...
 +__utmc%3D117945243%3B+__utmz
 function
              ...        4. Serve ga.js

 %3D117945243.1131054947.3.2.utmccn%3DGoogle Servers
 6. Read & write cookies                               Secure
 %28Spring%20Sale%29%7Cutmcsr%3D%28google
 7. Send gif request.
 %29%7Cutmcmd%3D%28ppc%29% %7Cutmtm%3D
 Request contains
 %28shoes%29%3B
 data.
                                    8. Serve gif
The __utm.gif hit
 __utm.gif?
 utmwv=6.3&utmn=101027544&utmsr=1280x854&utmsc=32-
 bit&utmul=en&utmje=1&utmjv=1.5&utmfl=7.0 r24&utmdt=My
 %20Website&utmhn=www.site.com&utmp=/
 index.html&utmac=UA-51244-4&utmcc=__utma
 %3D117945243.823564440.1131054947.1131080858.1133834
 608.4%3B+__utmb%3D117945243%3B+__utmc
 %3D117945243%3B+__utmz
 %3D117945243.1131054947.3.2.utmccn%3D%28Spring
 %20Sale%29%7Cutmcsr%3D%28google%29%7Cutmcmd%3D
 %28ppc%29% %7Cutmtm%3D%28shoes%29%3B

  Screen Resolution: 1280x854      Page Title: My Website
  Screen Colors: 32-bit            Hostname: www.site.com
  Browser Language: English(en)    Filename: /index.html
  Java Enabled? Yes (1)           	

                                   Google Analytics Account: UA-51244-4
  Java Version: 1.5               	

                                   Visits: 4
  Flash Version: 7.0r24            Campaign: Spring Sale | Google(PPC) |
                                   shoes
Raw Data to Reports




                      1
                      4
GATC Basics
Understand the website structure



      Single               Multiple
     domain                domains




       Multiple
         sub-              Multiple domains
       domains             and multiple sub-
                                domain
Simplest GATC Installation

 • All content on a single domain




 <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
 </script>
GATC – Multiple Sub-Domains

• Content exists on multiple sub-domains on a single top-level domain




<script type="text/javascript">
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-XXXXX-X']);
 _gaq.push(['_setDomainName', '.mysite.com']);
 _gaq.push(['_trackPageview']);

 (function() {
   var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
   ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 })();
</script>
GATC – Multiple Domains

• Content exists on multiple top-level domains



                                                                     _link()




<script type="text/javascript">                          Update all links between domains to include the _link() method.
 var _gaq = _gaq || [];                                   <a href=“http://www.mysite-support.com” onclick=“_gaq.push
 _gaq.push(['_setAccount', 'UA-XXXXX-X']);                              ([‘_link’, this.href]);”>Support</a>
 _gaq.push(['_setDomainName', ’none']);
 _gaq.push(['_setAllowLinker', true]);
 _gaq.push(['_trackPageview']);

 (function() {
   var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
   ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 })();
</script>
GATC – Multiple Domains and Sub-Domains

• Content exists on multiple sub-domains on multiple top-level domain



                                                                          _link()




                                                                             Update all links between domains to
<script type="text/javascript">                                                  include the _link() method.
 var _gaq = _gaq || [];
 _gaq.push(['_setAccount', 'UA-XXXXX-X']);                                    Do not change links between sub-
 _gaq.push(['_setDomainName', ’.mysite.com']);                                 domains on the same top-level
 _gaq.push(['_trackPageview']);                                                           domain.

 (function() {
   var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
   ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
   var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
 })();
</script>
Linking

 When content exists on multiple domains use linking methods to pass cookie
 information between domains:	

 	


 •  For HTTP GET include the _link() method.	

                                                  _link()
         •      Cookie info in URL parameters	

         •      Redirects user to the new URL	

       	

<a href=“http://www.example.com” onclick= “_gaq.push([‘_link’, this.href]);”>Example</a>	





 •  For HTTP POST include the _linkByPost() method.	

         •      Cookie info in action value	

         •      Used for forms and iFrames on other domains	

                                    SUBMIT

              	

<form action="http://www.shoppingcart.com/form.php" name="f" method="post”	

              	

 onsubmit=”_gaq.push([‘_linkByPost’, this]);">	

              	

 . . . </form>
Event Tracking
Event Tracking

•  Traditional Google Analytics is pageview based
What about the 1-page App/Site?
 • Single URL, no page refreshes
Enter Event Tracking

• Track events on your site
• Detect events and trigger tracking call




_gaq.push(['_trackEvent',            Purpose                    Example

            category,                Group of objects being     'Markers'
            action,                  tracked
                                     Type of user interaction   'Click'
            opt_label,               with the object
            opt_value]);             Additional info about      'Google
                                     the event                  Singapore'
                                     Numerical data about       1
                                     the event

                                                                             2
                                                                             5
Example: Tracking Outbound Social Media Links




                                                2
                                                6
Example: Tracking Outbound Links
YouTube Video Tracking Example




                       http://vinnysapidemos.googlecode.com/svn/trunk/
                        google/analytics/youtube/js-player-tracking.html
How did visitors interact with my videos? (Action)
Which videos were played? (Label)
Custom Variables
Custom Variables: Extended Measurement Model

                       Behaviour


  Entry                                                 Exit


                     Engagement
125+ Metrics and Dimensions+ X Custom Variables = Custom Measurement
                                                       Platform

                                                                  3
                                                                  2
Custom Variables

_setCustomVar(index, name, value, opt_scope);

•  index – position to store and transmit the variable (1 to 5)
•  name – variable name (e.g. “member-type”) (case sensitive)
•  value – variable value (e.g. “premium”) (case sensitive)
•  opt_scope – 1:visitor-level; 2:session-level; 3:page-level (default: 3)

•  Note: Length of Name + Value cannot exceed 64 characters




_setCustomVar(1, ‘foo’, ‘bar’, 2);
Visitor Level Custom Variables

               • Stays with the visitor across multiple visits
                 to the site
               • Cannot store personally identifiable
                 information


               _setCustomVar(
                1,
                ‘MembershipLevel’,
                ‘Platinum’,
                1);
Session Level Custom Variables

               • Labels a session
               • Variable is discarded once session ends


               _setCustomVar(
                3,
                ‘UsedChatWidget’,
                ‘true’,
                2);
Page Level Custom Variables

              • Useful for content grouping
              • Identify groups of pages according to
                attributes other than the page URL


              _setCustomVar(
               5,
               ‘Author’,
               ‘John Jane Doe’,
               3);
Social Interaction
Tracking
Measure use of social plugins on your website
What is social plugin tracking?

Social plugin tracking in Analytics
shows you:


•  How social plugins are used

•  Behavior of socially engaged users

•  Comparative performance of different social plugins

•  What content is socially engaging
Setup for +1 button

Setup for the       button: None


The +1 button on your website is already tracked.
Setup for other networks


• Other social buttons require a small javascript change to
  your website.



When a social plugin is used call this method:
     _trackSocial(network, action, target_url);
Copy & paste Twitter & Facebook code




 http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html
Tracking Social Interactions
MilkADeal.com




                      Google Confidential and Proprietary
<!– Email share button: -->
<a onclick="showMailer(&#039;Check out MilkADeal for huge
discounts in Malaysia! Here is my referral link: http://
milkadeal.com/r/&#039;);return false;" href="#"><div id="lnkMail"></
div></a>


<!– Functions to track email share button usage: -->
<script>
 function showMailer(myBody){
     _gaTrack();
     $(".winMessage").html(myBody);
     $("#mailer").modal();
 }

 function _gaTrack() {
     _gaq.push(['_trackSocial', 'email', 'share']);
 }
</script>
What value do socially-engaged visitors hold for us?




                      Google Confidential and Proprietary
Overview of Socially-Engaged Traffic




                     Google Confidential and Proprietary
Where are the conversions?




                    Google Confidential and Proprietary
Encourage more email sharing




                    Google Confidential and Proprietary
Campaign Variables
360 Degree Tracking




                      5
                      0
URL Campaign Variables


        http://www.yoursite.com/landingpage.html?
        utm_source=yahoo&utm_medium=cpc&utm_campaign=Ja
        n+2011+Campaign&utm_term=my+keyword



        http://www.yoursite.com/landingpage.html?
        utm_source=twitter&utm_medium=tweet&utm_campaign=J
        an+03+One+Day+Sale



        http://www.yoursite.com/landingpage.html?
        utm_source=email&utm_medium=link&utm_campaign=Jan
        +2011+Newsletter



                                                             5
                                                             1
Campaign Variable Basics


             Required Tags

             The Source is where the visitor was sent from.
                     Examples: google, nytimes.com, facebook.com




             The Medium is the channel in which this URL is promoted.
                     Examples: cpc, display, social, organic




             The Campaign should either indicate the overarching name for the
             marketing effort or just the specific ad campaign in which the ad
             lives.



             Optional Tags
             The Keyword is the search term that you bid on (search engines
             only)

             The Ad Content should indicate the ad name, copy, or other
             helpful information to identify the type of ad that was clicked.
Android Referral Tracking


         http://market.android.com/details?id=com.myorg.myapp&referrer=utm_source
         %3Dgoogle%26utm_medium%3Dcpc%26utm_term%3D
         %257Bkeyword%257D%26utm_content%3DAd%2520A
         %26utm_campaign%3DApp%2520Download 	





         http://yoursite.com/yourapp.apk&referrer=utm_source%3Dgoogle
         %26utm_medium%3Dcpc%26utm_term%3D%257Bkeyword%257D
         %26utm_content%3DAd%2520A%26utm_campaign%3DApp
         %2520Download 	





                                                                                5
                                                                                3
Example … Social Media

        http://www.yoursite.com/landingpage.html?
        utm_source=twitter&
        utm_medium=socialmedia&
        utm_campaign=My+social+campaign
Page Load Times
The Impact of Speed
Tracking setup

<script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-XXXXX-
X']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' ==
document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var
s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</
script>
Tracking setup

<script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-
XXXXXX']);_gaq.push(['_trackPageview']);_gaq.push(['_trackPageLoadTime']);
(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async
= true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);})();</script>
Tracking setup




                 Hit
Tracking setup




                 Time: 1.47 sec
Amari.com
Understanding Page Latency
Page Speed Online




                    pagespeed.googlelabs.com
Page Speed Recommendations
Before & After

     Amari Package Selection         Original
             Page                       Page
        Page Speed Score             62 / 100
       First View Load Time           8.739s

     Optimizations include:
      •  Removed whitespace in HTML
      •  Using minified versions of JS libraries
      •  Using minified CSS
      •  Serving optimised images
      •  Testing serving GZIPped (compressed) content
Before & After

     Amari Package Selection         Original Optimized           %
             Page                       Page      Page        Change
        Page Speed Score             62 / 100      67 / 100      5%
       First View Load Time           8.739s       7.738s     11.5%
     Optimizations include:
      •  Removed whitespace in HTML
      •  Using minified versions of JS libraries
      •  Using minified CSS
      •  Serving optimised images
      •  Testing serving GZIPped (compressed) content
Mobile Tracking
Mobile Tracking
         HTML &
                                                           WAP	

        Applications	





                      iPhone	





                                                                Windows 	

                                                                 Mobile	

                                                                              Blackberry	

                                  Android	





                                                                                Pearl &
                                                                                 Curve	

         http://code.google.com/apis/analytics/docs/tracking/mobileAppsTracking.html 	

                                                                                              6
                                                                                              8
Track Activity to Mobile Websites [link]




                Mobile Websites
                ü Server-side tracking
                ü Track all web-enabled devices (not just JS & cookie capable)
                ü Four languages supported: PHP, Perl, JSP, ASP
                ü Works just like Analytics on desktop web pages
Copy & Paste Snippets




                        7
                        0
A Quick Look at the PHP Code Snippet


                                            Insert a pixel for tracking
 Page rendering script

                         Generate the pixel URL


                                                   Send the request to GA




                         ga.php
                                                                          7
                                                                          1
Server-to-Server Communications




                                                            Secure Google Servers
                         Website Server
        Request pixel:                    Send request to
        /ga.php?....                      GA servers




                                                                                7
                                                                                2
Google Analytics Mobile SDK


                   Native App Tracking	

                   Unique Users	


                   Pageviews	


                   Events	


                   Ecommerce	


                   Custom Variables	


                   Android Market Referrals
Setting Up A Tracker Object In An Activity

	
GoogleAnalyticsTracker tracker;	
	
onCreate	
      tracker = GoogleAnalyticsTracker.getInstance();	
      tracker.startNewSession("UA-xxx-y", this);	
	




    74
Dispatching Events

Tracked data is queued and dispatched in bundles
• Saves battery life
• Can track when users are offline



tracker.dispatch();	
- or -	
tracker.start("UA-xxx-y", 20, this);	




  75
Tracking User Preferences

• How does user behavior differ by orientation?
Custom Variables




 Page	

 tracker.setCustomVar(1, “orientation”, “portrait”, 3); 	

 tracker.setCustomVar(1, “orientation”, “landscape”, 3);
Reporting on User Preferences
Reporting on User Preferences
Reporting on User Preferences
Reporting on User Preferences
Reporting on User Preferences
Tracking In-App Purchases

• How much revenue does my application generate?
• Which products are most popular?
Reporting In App Purchases
Other Platforms
Tracking on Other Platforms




                              8
                              6
Chrome Extensions

•  Load GA within Chrome extension page



 Call _trackPageView to measure
 extension activation


 Call _trackEvent to track
 interactions
Flash / Flex
               Track
                Pageviews
               Track Events
Silverlight




              8
              9
Resources
Subscribe for the Latest News


                                    Subscribe to receive latest
                                    articles in your inbox




conversionroom-japac.blogspot.com
code.google.com/apis/analytics
Starter Guides

•  Handy Google Analytics Resources:
   http://cse-sea.blogspot.com/2009/01/handy-google-
   analytics-resources.html
•  Getting Started is Easy:
   http://cse-sea.blogspot.com/2009/03/google-analytics-
   getting-started-is.html




                                                           9
                                                           3
ConversionUniversity.com




                           Your Name Here
Google Analytics Individual Qualification




                     Your Name Here
Parties Can Verify Your Qualification Online
Recap
•  Data is Gold
•  Tag & Track
  •  GA Tracking Code
  •  Event Tracking
  •  Custom Variables
  •  Social Interaction Tracking
  •  Campaign Variables
  •  Page Load Time Tracking

•  Take Action!!
Thank   You!        	

                    	

          @vinoaj; gplus.to/vinoaj; #devfestKL

DevFest Kuala Lumpur - Implementing Google Analytics - 2011-09-29.ppt

  • 1.
    Slides: goo.gl/TUHB1 Implementing Google Q&A: goo.gl/6ADXU Analytics Vinoaj Vijeyakumaar Senior Conversion Specialist, gplus.to/vinoaj Google Southeast Asia twitter.com/vinoaj #devfestKL conversionroom-japac.blogspot.com Kuala Lumpur, 2011
  • 2.
  • 3.
    The Role ofthe Web Analyst Reporting Actionable Insights http://www.flickr.com/photos/kire/797533507/sizes/o/in/photostream/
  • 4.
    What does “Action”mean? Discovering new opportunities (eg. New markets, hot trends, customer segments) Optimisation Improving marketing strategies Maximising reach (eg. New markets, optimise messaging) of your apps and delighting users Enhancing the user experience (eg. Compelling content, optimal user flows)
  • 5.
    Agenda • How GA Works • Tracking –  Basics –  Event Tracking –  Custom Variables –  Social Interaction Tracking –  Campaign Variables –  Page Load Time Tracking • Mobile Tracking –  WAP –  Android and iOS • Tracking Other Platforms
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
    Track Behaviour Behaviour Entry Exit Engagement Reports on 125+ standard metrics and dimensions 1 0
  • 11.
    The GA AsyncTracking Code Look for _gaq stack and execute queued commands HTML5: Execute script asynchronously Dynamically load the ga.js tracking library 1 1
  • 12.
    How Google Analyticsworks 1. Request--"Show me this Website Server webpage" __utm.gif? utmwv=6.3&utmn=101027544&utmsr=1280x854&utm sc=32-bit&utmul=en&utmje=1&utmjv=1.5&utmfl=7.0 r24&utmdt=My <html> <head> ... 2. Serve page %20Website&utmhn=www.site.com&utmp=/ ... index.html&utmac=UA-51244-4&utmcc=__utma User %3D117945243.823564440.1131054947.1131080858.1 3. Request: ga.js 133834608.4%3B+__utmb%3D117945243%3B </head> <html> 5. Call trackPageview() ... +__utmc%3D117945243%3B+__utmz function ... 4. Serve ga.js %3D117945243.1131054947.3.2.utmccn%3DGoogle Servers 6. Read & write cookies Secure %28Spring%20Sale%29%7Cutmcsr%3D%28google 7. Send gif request. %29%7Cutmcmd%3D%28ppc%29% %7Cutmtm%3D Request contains %28shoes%29%3B data. 8. Serve gif
  • 13.
    The __utm.gif hit __utm.gif? utmwv=6.3&utmn=101027544&utmsr=1280x854&utmsc=32- bit&utmul=en&utmje=1&utmjv=1.5&utmfl=7.0 r24&utmdt=My %20Website&utmhn=www.site.com&utmp=/ index.html&utmac=UA-51244-4&utmcc=__utma %3D117945243.823564440.1131054947.1131080858.1133834 608.4%3B+__utmb%3D117945243%3B+__utmc %3D117945243%3B+__utmz %3D117945243.1131054947.3.2.utmccn%3D%28Spring %20Sale%29%7Cutmcsr%3D%28google%29%7Cutmcmd%3D %28ppc%29% %7Cutmtm%3D%28shoes%29%3B Screen Resolution: 1280x854 Page Title: My Website Screen Colors: 32-bit Hostname: www.site.com Browser Language: English(en) Filename: /index.html Java Enabled? Yes (1) Google Analytics Account: UA-51244-4 Java Version: 1.5 Visits: 4 Flash Version: 7.0r24 Campaign: Spring Sale | Google(PPC) | shoes
  • 14.
    Raw Data toReports 1 4
  • 15.
  • 16.
    Understand the websitestructure Single Multiple domain domains Multiple sub- Multiple domains domains and multiple sub- domain
  • 17.
    Simplest GATC Installation • All content on a single domain <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
  • 18.
    GATC – MultipleSub-Domains • Content exists on multiple sub-domains on a single top-level domain <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); _gaq.push(['_setDomainName', '.mysite.com']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
  • 19.
    GATC – MultipleDomains • Content exists on multiple top-level domains _link() <script type="text/javascript"> Update all links between domains to include the _link() method. var _gaq = _gaq || []; <a href=“http://www.mysite-support.com” onclick=“_gaq.push _gaq.push(['_setAccount', 'UA-XXXXX-X']); ([‘_link’, this.href]);”>Support</a> _gaq.push(['_setDomainName', ’none']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
  • 20.
    GATC – MultipleDomains and Sub-Domains • Content exists on multiple sub-domains on multiple top-level domain _link() Update all links between domains to <script type="text/javascript"> include the _link() method. var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXX-X']); Do not change links between sub- _gaq.push(['_setDomainName', ’.mysite.com']); domains on the same top-level _gaq.push(['_trackPageview']); domain. (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
  • 21.
    Linking When contentexists on multiple domains use linking methods to pass cookie information between domains: •  For HTTP GET include the _link() method. _link() •  Cookie info in URL parameters •  Redirects user to the new URL <a href=“http://www.example.com” onclick= “_gaq.push([‘_link’, this.href]);”>Example</a> •  For HTTP POST include the _linkByPost() method. •  Cookie info in action value •  Used for forms and iFrames on other domains SUBMIT <form action="http://www.shoppingcart.com/form.php" name="f" method="post” onsubmit=”_gaq.push([‘_linkByPost’, this]);"> . . . </form>
  • 22.
  • 23.
    Event Tracking •  TraditionalGoogle Analytics is pageview based
  • 24.
    What about the1-page App/Site? • Single URL, no page refreshes
  • 25.
    Enter Event Tracking • Trackevents on your site • Detect events and trigger tracking call _gaq.push(['_trackEvent', Purpose Example category, Group of objects being 'Markers' action, tracked Type of user interaction 'Click' opt_label, with the object opt_value]); Additional info about 'Google the event Singapore' Numerical data about 1 the event 2 5
  • 26.
    Example: Tracking OutboundSocial Media Links 2 6
  • 27.
  • 28.
    YouTube Video TrackingExample http://vinnysapidemos.googlecode.com/svn/trunk/ google/analytics/youtube/js-player-tracking.html
  • 29.
    How did visitorsinteract with my videos? (Action)
  • 30.
    Which videos wereplayed? (Label)
  • 31.
  • 32.
    Custom Variables: ExtendedMeasurement Model Behaviour Entry Exit Engagement 125+ Metrics and Dimensions+ X Custom Variables = Custom Measurement Platform 3 2
  • 33.
    Custom Variables _setCustomVar(index, name,value, opt_scope); •  index – position to store and transmit the variable (1 to 5) •  name – variable name (e.g. “member-type”) (case sensitive) •  value – variable value (e.g. “premium”) (case sensitive) •  opt_scope – 1:visitor-level; 2:session-level; 3:page-level (default: 3) •  Note: Length of Name + Value cannot exceed 64 characters _setCustomVar(1, ‘foo’, ‘bar’, 2);
  • 34.
    Visitor Level CustomVariables • Stays with the visitor across multiple visits to the site • Cannot store personally identifiable information _setCustomVar( 1, ‘MembershipLevel’, ‘Platinum’, 1);
  • 35.
    Session Level CustomVariables • Labels a session • Variable is discarded once session ends _setCustomVar( 3, ‘UsedChatWidget’, ‘true’, 2);
  • 36.
    Page Level CustomVariables • Useful for content grouping • Identify groups of pages according to attributes other than the page URL _setCustomVar( 5, ‘Author’, ‘John Jane Doe’, 3);
  • 37.
  • 38.
    Measure use ofsocial plugins on your website
  • 39.
    What is socialplugin tracking? Social plugin tracking in Analytics shows you: •  How social plugins are used •  Behavior of socially engaged users •  Comparative performance of different social plugins •  What content is socially engaging
  • 40.
    Setup for +1button Setup for the button: None The +1 button on your website is already tracked.
  • 41.
    Setup for othernetworks • Other social buttons require a small javascript change to your website. When a social plugin is used call this method: _trackSocial(network, action, target_url);
  • 42.
    Copy & pasteTwitter & Facebook code http://code.google.com/apis/analytics/docs/tracking/gaTrackingSocial.html
  • 43.
    Tracking Social Interactions MilkADeal.com Google Confidential and Proprietary
  • 44.
    <!– Email sharebutton: --> <a onclick="showMailer(&#039;Check out MilkADeal for huge discounts in Malaysia! Here is my referral link: http:// milkadeal.com/r/&#039;);return false;" href="#"><div id="lnkMail"></ div></a> <!– Functions to track email share button usage: --> <script> function showMailer(myBody){ _gaTrack(); $(".winMessage").html(myBody); $("#mailer").modal(); } function _gaTrack() { _gaq.push(['_trackSocial', 'email', 'share']); } </script>
  • 45.
    What value dosocially-engaged visitors hold for us? Google Confidential and Proprietary
  • 46.
    Overview of Socially-EngagedTraffic Google Confidential and Proprietary
  • 47.
    Where are theconversions? Google Confidential and Proprietary
  • 48.
    Encourage more emailsharing Google Confidential and Proprietary
  • 49.
  • 50.
  • 51.
    URL Campaign Variables http://www.yoursite.com/landingpage.html? utm_source=yahoo&utm_medium=cpc&utm_campaign=Ja n+2011+Campaign&utm_term=my+keyword http://www.yoursite.com/landingpage.html? utm_source=twitter&utm_medium=tweet&utm_campaign=J an+03+One+Day+Sale http://www.yoursite.com/landingpage.html? utm_source=email&utm_medium=link&utm_campaign=Jan +2011+Newsletter 5 1
  • 52.
    Campaign Variable Basics Required Tags The Source is where the visitor was sent from. Examples: google, nytimes.com, facebook.com The Medium is the channel in which this URL is promoted. Examples: cpc, display, social, organic The Campaign should either indicate the overarching name for the marketing effort or just the specific ad campaign in which the ad lives. Optional Tags The Keyword is the search term that you bid on (search engines only) The Ad Content should indicate the ad name, copy, or other helpful information to identify the type of ad that was clicked.
  • 53.
    Android Referral Tracking http://market.android.com/details?id=com.myorg.myapp&referrer=utm_source %3Dgoogle%26utm_medium%3Dcpc%26utm_term%3D %257Bkeyword%257D%26utm_content%3DAd%2520A %26utm_campaign%3DApp%2520Download http://yoursite.com/yourapp.apk&referrer=utm_source%3Dgoogle %26utm_medium%3Dcpc%26utm_term%3D%257Bkeyword%257D %26utm_content%3DAd%2520A%26utm_campaign%3DApp %2520Download 5 3
  • 54.
    Example … SocialMedia http://www.yoursite.com/landingpage.html? utm_source=twitter& utm_medium=socialmedia& utm_campaign=My+social+campaign
  • 55.
  • 56.
  • 57.
    Tracking setup <script type="text/javascript">var_gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-XXXXX- X']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</ script>
  • 58.
    Tracking setup <script type="text/javascript">var_gaq = _gaq || [];_gaq.push(['_setAccount', 'UA- XXXXXX']);_gaq.push(['_trackPageview']);_gaq.push(['_trackPageLoadTime']); (function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>
  • 59.
  • 60.
    Tracking setup Time: 1.47 sec
  • 61.
  • 62.
  • 63.
    Page Speed Online pagespeed.googlelabs.com
  • 64.
  • 65.
    Before & After Amari Package Selection Original Page Page Page Speed Score 62 / 100 First View Load Time 8.739s Optimizations include: •  Removed whitespace in HTML •  Using minified versions of JS libraries •  Using minified CSS •  Serving optimised images •  Testing serving GZIPped (compressed) content
  • 66.
    Before & After Amari Package Selection Original Optimized % Page Page Page Change Page Speed Score 62 / 100 67 / 100 5% First View Load Time 8.739s 7.738s 11.5% Optimizations include: •  Removed whitespace in HTML •  Using minified versions of JS libraries •  Using minified CSS •  Serving optimised images •  Testing serving GZIPped (compressed) content
  • 67.
  • 68.
    Mobile Tracking HTML & WAP Applications iPhone Windows Mobile Blackberry Android Pearl & Curve http://code.google.com/apis/analytics/docs/tracking/mobileAppsTracking.html 6 8
  • 69.
    Track Activity toMobile Websites [link] Mobile Websites ü Server-side tracking ü Track all web-enabled devices (not just JS & cookie capable) ü Four languages supported: PHP, Perl, JSP, ASP ü Works just like Analytics on desktop web pages
  • 70.
    Copy & PasteSnippets 7 0
  • 71.
    A Quick Lookat the PHP Code Snippet Insert a pixel for tracking Page rendering script Generate the pixel URL Send the request to GA ga.php 7 1
  • 72.
    Server-to-Server Communications Secure Google Servers Website Server Request pixel: Send request to /ga.php?.... GA servers 7 2
  • 73.
    Google Analytics MobileSDK Native App Tracking Unique Users Pageviews Events Ecommerce Custom Variables Android Market Referrals
  • 74.
    Setting Up ATracker Object In An Activity GoogleAnalyticsTracker tracker; onCreate tracker = GoogleAnalyticsTracker.getInstance(); tracker.startNewSession("UA-xxx-y", this); 74
  • 75.
    Dispatching Events Tracked datais queued and dispatched in bundles • Saves battery life • Can track when users are offline tracker.dispatch(); - or - tracker.start("UA-xxx-y", 20, this); 75
  • 76.
    Tracking User Preferences • Howdoes user behavior differ by orientation?
  • 77.
    Custom Variables Page tracker.setCustomVar(1, “orientation”, “portrait”, 3); tracker.setCustomVar(1, “orientation”, “landscape”, 3);
  • 78.
    Reporting on UserPreferences
  • 79.
    Reporting on UserPreferences
  • 80.
    Reporting on UserPreferences
  • 81.
    Reporting on UserPreferences
  • 82.
    Reporting on UserPreferences
  • 83.
    Tracking In-App Purchases • Howmuch revenue does my application generate? • Which products are most popular?
  • 84.
  • 85.
  • 86.
    Tracking on OtherPlatforms 8 6
  • 87.
    Chrome Extensions •  LoadGA within Chrome extension page Call _trackPageView to measure extension activation Call _trackEvent to track interactions
  • 88.
    Flash / Flex Track Pageviews Track Events
  • 89.
  • 90.
  • 91.
    Subscribe for theLatest News Subscribe to receive latest articles in your inbox conversionroom-japac.blogspot.com
  • 92.
  • 93.
    Starter Guides •  HandyGoogle Analytics Resources: http://cse-sea.blogspot.com/2009/01/handy-google- analytics-resources.html •  Getting Started is Easy: http://cse-sea.blogspot.com/2009/03/google-analytics- getting-started-is.html 9 3
  • 94.
  • 95.
    Google Analytics IndividualQualification Your Name Here
  • 96.
    Parties Can VerifyYour Qualification Online
  • 97.
  • 98.
    •  Data isGold •  Tag & Track •  GA Tracking Code •  Event Tracking •  Custom Variables •  Social Interaction Tracking •  Campaign Variables •  Page Load Time Tracking •  Take Action!!
  • 99.
    Thank You! @vinoaj; gplus.to/vinoaj; #devfestKL