Last active
          October 25, 2015 14:59 
        
      - 
      
- 
        Save iTonyYo/9927606 to your computer and use it in GitHub Desktop. 
    Google analytics code snippet with jade template engine. Jade ' include ' allows you to insert the contents into another jade file simply.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // | |
| Build Passing. | |
| Doctype: HTML5 | |
| Jade: 1.3.0+ | |
| #TODO[x]: Google analytics References | |
| https://developers.google.com/analytics/ →_→ Optimize Your | |
| Business Using the Google Analytics Platform | |
| https://developers.google.com/analytics/devguides/collection/ | |
| Google Analytics provides easy to use APIs and SDKs to send | |
| data to Google Analytics. | |
| http://mathiasbynens.be/notes/async-analytics-snippet →_→ Opti- | |
| mizing the asynchronous Google Analytics snippet | |
| script. | |
| var trackID, domainID; | |
| trackID = ''; //eg: 'UA-34398778-4'. | |
| domainID = ''; //eg: 'studio7designs.com'. | |
| (function (i, s, o, g, r, a, m) { | |
| i['GoogleAnalyticsObject'] = r; | |
| i[r] = i[r] || function () { | |
| (i[r].q = i[r].q || []).push(arguments); | |
| }, | |
| i[r].l = 1 * new Date(); | |
| a = s.createElement(o), | |
| m = s.getElementsByTagName(o)[0]; | |
| a.async = 1; | |
| a.defer = 1; | |
| a.src = g; | |
| m.parentNode.insertBefore(a,m) | |
| })(window, document, 'script','//www.google-analytics.com/analytics.js', 'ga'); | |
| ga('create', trackID, domainID); | |
| ga('send', 'pageview'); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
so how do you include it in your page?