Skip to content

Commit

Permalink
Use https:// in the Google Analytics snippet
Browse files Browse the repository at this point in the history
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 eee759b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit eee759b

Please sign in to comment.