Overview
Prerequisites
If not already done so, create a Google Analytics account.
1. Create a new property
Go to 'Admin' in Google Analytics. Click 'Create Property' in the 'Property' section.
Enter the new property name, select your reporting timezone, currency; then click 'Show advanced options'.
- Enter the URL of the website
- Click 'Create a Universal Analytics property', and select 'Create a Univeral Analytics property only'
- Click 'Next', answer some questions, then click 'Create'. Copy the tracking code.
2. Add tracking code
Paste the code in the head of index.html. Build and deploy your project.
3. Test
In 'Tracking Info > Tracking Code', click the 'Send test traffic' button. If successful, 'Status' will display '1 active users right now (including 1 from test traffic)'.