Member-only story
Ever wanted to know where your sites are being viewed, how many people are even seeing them, and what’s being done on those pages?
Google Analytics is your answer, and it’s super simple to set up.
- Navigate to google.com/analytics and set up an account/sign in
- Create a property
- Click settings > setup assistant > tag installation > add stream > web
- Create a new stream
- Click Global Site Tag and copy the script.
It should look something like this:
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=ID_HERE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'ID_HERE');
</script>
6. Paste that into the head of your index.html file in your React App (assuming you’re using React)
And that’s it! Now anytime you have a visitor on your site, this script is run and tracks things like page views, scrolls, outbound clicks, site search, video engagement, and file downloads.