Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Analytics Tracking for CDN #568

Closed
wants to merge 3 commits into from

Commits on Jun 10, 2013

  1. Add GA Pixel to CDN Version

    I ended up just manually minifying and adding the pixel to the build script, but here's the original notes on the url pieces that I made.
    /**
     * Google Analytics tracking pixel for the freely hosted version of Video.js
     * at vjs.zencdn.net. We'll use this data to develop a support matrix of
     * browsers and devices.
     *
     * This code generates the GA tracking URL without requiring the GA javascript
     * library.
     *
     * @type {Image}
     */
     ;(function(img){
       img.src = '//www.google-analytics.com/__utm.gif'
         + '?utmwv=5.4.2' // Version
         + '&utmac=UA-16505296-2' // ID
         // &utms=2 // Sessions
         + '&utmn='+Math.floor(Math.random() * 10000000000) // Cache breaker
         + '&utmhn='+encodeURIComponent(window.location.hostname)
         // &utmcs=UTF-8 // Encoding
         + '&utmsr='+window.screen.availWidth+'x'+window.screen.availHeight
         // &utmvp=1057x1105 // Browser window
         // &utmsc=24-bit // Color depth
         + '&utmul='+ (navigator.language || navigator.userLanguage)
         // &utmje=1 // Java
         // &utmfl=11.7%20r700 // Flash version
         // &utmdt=HTML5%20Video%20Player%20%7C%20Video.js // Page title
         // &utmhid=1112291628 // Adsense
         // + '&utmr='+(document.referrer || '-') // Referrer, '-' is none
         + '&utmp='+encodeURIComponent(window.location.pathname)
         // &utmht=1370890439353 // ?
         // &utmcc=__utma%3D59332138.2144546446.1350079499.1369781272.1370890430.57%3B%2B__utmz%3D59332138.1368060482.49.3.utmcsr%3Dlocalhost%3A8080%7Cutmccn%3D(referral)%7Cutmcmd%3Dreferral%7Cutmcct%3D%2F%3B // Cookies
         // &utmu=q // ?
       ;
     })(new Image());
    heff committed Jun 10, 2013
    Configuration menu
    Copy the full SHA
    8bcd4b2 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2013

  1. Added cookies and a custom version var to analytics tracking code

    Added cdn.js so we can actually have notes around the analytics code
    heff committed Jun 11, 2013
    Configuration menu
    Copy the full SHA
    b968fac View commit details
    Browse the repository at this point in the history
  2. Fixed a linting issue.

    heff committed Jun 11, 2013
    Configuration menu
    Copy the full SHA
    f198eb1 View commit details
    Browse the repository at this point in the history