The site uses Google Analytics 4 directly via gtag.js. There is no Google Tag Manager — events are fired from the code, keeping the setup simple and requiring no external container configuration.
- Measurement ID:
G-593HJXNS18 - Domain: greensoftware.foundation
- Snippet location:
src/layouts/showcase.astro(in<head>)
The same measurement ID was previously loaded via GTM (GTM-WTDZZJF) on the legacy Gatsby site. The GTM container is no longer used.
These are built-in GA4 events — no custom code required. Ensure they're enabled in GA4 Admin → Data Streams → Enhanced Measurement.
| Event | What it tracks |
|---|---|
page_view |
Every page load |
click (outbound) |
Clicks to external domains (not greensoftware.foundation) |
scroll |
90% scroll depth |
file_download |
Clicks on document/file links |
| Event name | File | When it fires | Parameters |
|---|---|---|---|
newsletter_submission |
src/components/react/newsletter-form.tsx |
Successful newsletter signup (any location — inline or footer) | form_variant: "inline" or "compact" |
membership_enquiry |
src/pages/membership.astro |
Click on any membership enquiry mailto link | click_location: nearest section heading text |
assembly_application |
src/pages/assemblies/[slug].astro |
Successful assembly application form submission | assembly_name: name of the assembly |
Use gtag('event', ...) directly — no dataLayer or GTM triggers needed:
if ((window as any).gtag) {
(window as any).gtag("event", "event_name", {
parameter_name: "value",
});
}Follow GA4 naming conventions: snake_case for event names and parameter names.
Subdomains like wiki.greensoftware.foundation, assemblies.greensoftware.foundation, and policy-radar.greensoftware.foundation are treated as internal by default in GA4. Clicks to these won't appear as outbound clicks unless you change the cross-domain settings in the data stream configuration.
GA4 receives events regardless of which domain sends them. The data stream URL doesn't need to match.
-
Realtime report — deploy or run locally, then check GA4 → Reports → Realtime. Events appear within seconds.
-
DebugView (more detailed) — install the Google Analytics Debugger Chrome extension, enable it, visit your site, then open GA4 → Admin → DebugView. Shows every event with full parameter details.
-
Browser DevTools — open the Network tab, filter by
collect, and you'll see requests togoogle-analytics.com/g/collectwith event parameters in the query string.
Run npm run build then preview the built site. The gtag snippet loads and fires events normally. (The dev server also works but PageFind won't be available without a build.)
- Data collected under the old GTM setup is preserved in the same GA4 property
- The legacy newsletter event was called
Newsletter Submission(title case, set by GTM). The new event isnewsletter_submission(snake_case). These appear as separate events in GA4 reports - All other historical events (page views, outbound clicks) continue uninterrupted
The Google Analytics MCP server lets Claude (Desktop or Code) query our GA4 data directly — run reports, check real-time stats, list custom dimensions, etc.
You'll be given a file called analytics-mcp-key.json — this is the credentials file. Keep it private and don't share it over email or commit it to git.
- Open Finder
- Press Cmd + Shift + G (Go to Folder)
- Type
~/.secretsand press Enter- If it says the folder doesn't exist, type
~instead, press Enter, then create a new folder called.secrets - Note: folders starting with
.are hidden. If you need to see it again later, press Cmd + Shift + . in Finder to show hidden files
- If it says the folder doesn't exist, type
- Drag the
analytics-mcp-key.jsonfile into this.secretsfolder
- Open Finder
- Press Cmd + Shift + G
- Type
~/Library/Application Support/Claudeand press Enter - You should see a file called
claude_desktop_config.json - Right-click it → Open With → TextEdit
- You'll see something like this:
{
"mcpServers": {}
}- Replace the entire contents of the file with:
{
"mcpServers": {
"analytics-mcp": {
"command": "/opt/homebrew/bin/pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/Users/YOURUSERNAME/.secrets/analytics-mcp-key.json",
"GOOGLE_PROJECT_ID": "helpy-gsf"
}
}
}
}- Replace
YOURUSERNAMEwith your Mac username- Not sure what it is? Open Finder → click Go in the menu bar → Home. The folder name at the top is your username
- Save the file (Cmd + S) and close TextEdit
- Quit Claude Desktop completely (right-click the dock icon → Quit), then reopen it
This is the only step that requires the terminal — ask a colleague to help, or:
- Open Terminal (press Cmd + Space, type "Terminal", press Enter)
- Copy and paste this line, then press Enter:
brew install pipx && pipx ensurepath
- If you get "brew: command not found", paste this first, then try again:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Close and reopen Terminal, then run the
brew install pipx && pipx ensurepathline again
- Open File Explorer
- Click in the address bar at the top and type
%USERPROFILE%then press Enter — this takes you to your home folder (e.g.C:\Users\YourName) - Create a new folder called
.secrets- Right-click → New → Folder → name it
.secrets - Windows may warn you about the dot — click Yes
- Right-click → New → Folder → name it
- Drag the
analytics-mcp-key.jsonfile into this.secretsfolder
- Open File Explorer
- Click in the address bar and type
%APPDATA%\Claudethen press Enter - You should see a file called
claude_desktop_config.json - Right-click it → Open with → Notepad
- Replace the entire contents of the file with:
{
"mcpServers": {
"analytics-mcp": {
"command": "pipx",
"args": ["run", "analytics-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:\\Users\\YOURUSERNAME\\.secrets\\analytics-mcp-key.json",
"GOOGLE_PROJECT_ID": "helpy-gsf"
}
}
}
}- Replace
YOURUSERNAMEwith your Windows username- Not sure what it is? Look at the address bar in File Explorer when you're in your home folder — it's the name after
Users\
- Not sure what it is? Look at the address bar in File Explorer when you're in your home folder — it's the name after
- Save the file (Ctrl + S) and close Notepad
- Quit Claude Desktop completely (right-click the icon in the system tray near the clock → Quit), then reopen it
- Open the Start menu, type
cmd, and press Enter - Copy and paste this line, then press Enter:
pip install pipx && pipx ensurepath
- If you get "pip: not recognized", you need Python first — download it from python.org, install it, and tick "Add to PATH" during installation. Then close and reopen cmd and try the line above again.
Open Claude Desktop and type:
What can the analytics-mcp server do?
If it lists analytics tools, you're all set. If you see an error, check that:
- The
YOURUSERNAMEin the config matches your actual username - The
analytics-mcp-key.jsonfile is in the.secretsfolder - You restarted Claude Desktop after editing the config