Integrate multiple google analytics in one script

This article is related to the GTMetrix points assessment Reduce unused JavaScript which is usually found in the section

Follow the guidelines from

So each google analytics code is separate, and if you use multiple analytics code in one website, then this can be simplified to:
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXX-13');
  gtag('config', 'G-XXXXXXXXXX');

This post is also available in: Indonesian

Leave a Reply

Your email address will not be published. Required fields are marked *