Skip to content

Google Analytics tracking ID

The Google Analytics tracking ID is a unique identifier, such as UA-126790141-1, assigned to a specific website property when registered with Google Analytics^[600-developer-frontend-google-google.md].

Implementation

To enable tracking, the ID must be integrated into the website's source code. This is typically done by inserting a JavaScript snippet into the site's footer or layout partials^[600-developer-frontend-google-google.md]. The standard implementation uses the global site tag (gtag.js), where the tracking ID is passed as a parameter in the configuration command^[600-developer-frontend-google-google.md]:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-126790141-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-126790141-1');
</script>
  • [[Google Analytics]]
  • [[AdSense ID]]
  • [[JavaScript]]

Sources

^[600-developer-frontend-google-google.md]