Skip to content
Permalink
Browse files

Use `https://` in the Google Analytics snippet

Nowadays HTTPS is fast and increasingly necessary, so using
protocol-relative URLs is becoming an anti-pattern, especially for CDNs.

From https://developers.google.com/speed/libraries/devguide?csw=1#libraries:

 " We recommend that you load libraries from the CDN via HTTPS, even
   if your own website only uses HTTP. Nowadays, performance is fast
   and caching works just the same "

See also: https://github.com/konklone/cdns-to-https#conclusion-cdns-should-redirect-to-https
  • Loading branch information...
alrra committed Mar 11, 2015
1 parent 5734227 commit eee759bfe175e850bbc8e4ad0682ec4fe4bd05d6
Showing with 3 additions and 2 deletions.
  1. +1 −0 CHANGELOG.md
  2. +1 −1 dist/index.html
  3. +1 −1 src/index.html
@@ -1,5 +1,6 @@
### HEAD

* Use `https://` in the Google Universal Analytics snippet.
* Include the `LICENSE.txt` file in the `dist/` directory
([#1655](https://github.com/h5bp/html5-boilerplate/issues/1655)).
* Remove the `visibility: hidden` declaration from `.hidden`
@@ -32,7 +32,7 @@
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
@@ -32,7 +32,7 @@
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>

0 comments on commit eee759b

Please sign in to comment.
You can’t perform that action at this time.