Skip to content

Commit c9c6160

Browse files
authored
Add setup instructions for GA and GTM to README (#1332)
* add setup for ga and gtm to readme * instruction to set hugo env to production * update readme
1 parent f75befa commit c9c6160

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,33 @@ To locally serve the site at [localhost:8888][], run the following command:
3939
$ npm run serve
4040
```
4141

42+
## Setup Google Analytics (GA) and Google Tag Manager (GTM)
43+
44+
1. **Google Analytics (GA):**
45+
- Follow the [GA setup guide](https://support.google.com/analytics/answer/9304153) to create your account, property, and data stream.
46+
- Update `config.yaml` with your GA Measurement ID:
47+
48+
```yaml
49+
params:
50+
googleAnalytics: "G-XXXXXXXXXX" # Replace with your GA Measurement ID
51+
```
52+
Verify GA setup using real-time reports to ensure data from your website is being tracked.
53+
54+
2. **Google Tag Manager (GTM):**
55+
- Follow the [GTM setup guide](https://developers.google.com/tag-platform/tag-manager/web) to create your account and container.
56+
- Update `config.yaml` with your GTM ID:
57+
58+
```yaml
59+
params:
60+
gtmID: "GTM-XXXXXXXX" # Replace with your GTM ID
61+
```
62+
Check GTM setup using Preview mode and verify that Tag Assistant displays "Connected" for your website URL.
63+
64+
Build the site by setting Hugo environment to production to make sure GA and GTM work.
65+
```console
66+
$ HUGO_ENV=production npm run serve
67+
```
68+
4269
## Site deploys and PR previews
4370

4471
If you submit a PR, Netlify will create a [deploy preview][] so that you can

0 commit comments

Comments
 (0)