To use analytics to collect website data, what must be added to the website page HTML?

To use analytics to collect website data, you typically need to add a tracking code snippet provided by your analytics service provider to the HTML code of your website pages. Add the Tracking Code Snippet:

Sign Up for Google Analytics by following this link https://analytics.google.com/

Add the Tracking Code to HTML :

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

gtag('config', 'UA-XXXXXXXXX-X');
</script>

Go from files to website in seconds.

Start a free trial for 7 days — no credit card required

Get Started for Free