Skip to content

Commit eee759b

Browse files
committed
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
1 parent 5734227 commit eee759b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### HEAD
22

3+
* Use `https://` in the Google Universal Analytics snippet.
34
* Include the `LICENSE.txt` file in the `dist/` directory
45
([#1655](https://github.com/h5bp/html5-boilerplate/issues/1655)).
56
* Remove the `visibility: hidden` declaration from `.hidden`

dist/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
3333
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
3434
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
35-
e.src='//www.google-analytics.com/analytics.js';
35+
e.src='https://www.google-analytics.com/analytics.js';
3636
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
3737
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
3838
</script>

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
3333
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
3434
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
35-
e.src='//www.google-analytics.com/analytics.js';
35+
e.src='https://www.google-analytics.com/analytics.js';
3636
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
3737
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
3838
</script>

0 commit comments

Comments
 (0)