Issue Feature Closed

#28382Allow asynchronous JavaScript files

Xavier Perseguers 07/22/11, 10:14 updated 10/02/18, 12:41

Description

Instead of evaluating Google Analytics code right away, the official snippet allows asynchronous evaluation, if browser supports it:

<script type="text/javascript">
  // code stripped
  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

Add new option ‘async’ to PAGE.includeJS.<array></array>

Reviews 5