Skip to content
Snippets Groups Projects
This project is mirrored from https://:*****@github.com/ebiwd/EBI-Framework.git. Pull mirroring updated .
  1. Jul 27, 2017
  2. Jul 12, 2017
  3. Jul 10, 2017
  4. Jul 06, 2017
  5. Jul 05, 2017
    • wbazant's avatar
      Do not pollute global scope - enables Google Analytics to work correctly · 0d6ad6f9
      wbazant authored
      Google tells you to use analytics by including this snippet:
      <script>
        (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.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
      
        ga('create','unique tracker id', 'auto');
        ga('send', 'pageview');
      </script>
      
      i[r] is window['ga'] and if it's something truthy ([] is truthy) the snippet does nothing.
      
      At the same time foundationExtendEBI.js can not rely on window.ga being there (individual teams will have their own tracker, or not) so add an if-exists-then before each function call.
      0d6ad6f9
  6. Jun 21, 2017
  7. Jun 19, 2017
  8. Jun 12, 2017
  9. Jun 07, 2017
  10. May 18, 2017
  11. May 13, 2017
  12. May 12, 2017
  13. May 11, 2017