Skip to content
Back to skills

Configure Analytics

ASecurity

Repeatable skill for setting up Plausible, PostHog, and GA4 analytics keys in both local `.env` and Railway production environment variables.

  • 27 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 3, 2026
ai-agentsgobashgitapi

Works with

  • cli
  • api
  • mcp

Security analysis

A96/100
  • mediumUses curl or wget to download content

Pro shows the line behind each finding and how to fix it

Scanned September 3, 2026

npx -y skills add IgorGanapolsky/ThumbGate --skill configure-analytics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Configure Analytics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Configure Analytics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/igorganapolsky-configure-analytics/badge)](https://www.skillsdirectory.com/skills/igorganapolsky-configure-analytics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Skill: Configure Analytics

Repeatable skill for setting up Plausible, PostHog, and GA4 analytics keys
in both local `.env` and Railway production environment variables.

## When to use

- New session notices analytics env vars are missing
- After rotating any analytics API key
- After creating a new GA4 property

## Prerequisites

- Chrome logged into: plausible.io, us.posthog.com, analytics.google.com
- Railway MCP authenticated OR Chrome logged into railway.com

## Steps

### 1. Gather keys from dashboards

**Plausible API key:**
- Navigate to https://plausible.io/settings/api-keys
- If no key exists, create one named "thumbgate-railway-prod"
- Copy the key value

**PostHog project API key:**
- Navigate to https://us.posthog.com/settings/project#variables
- Copy the "Project API Key" (starts with `phc_`)

**GA4 Measurement ID:**
- Navigate to https://analytics.google.com
- Select the ThumbGate property (or create one: Admin → Create Property)
- Go to Data Streams → Web stream → copy Measurement ID (format: G-XXXXXXXXXX)
- If no ThumbGate property exists, skip — Plausible is primary

### 2. Set local .env

Write/update `repo/.env` with:
```
PLAUSIBLE_API_KEY=<key>
PLAUSIBLE_SITE_ID=thumbgate-production.up.railway.app
POSTHOG_API_KEY=<phc_key>
THUMBGATE_GA_MEASUREMENT_ID=<G-ID or leave commented>
```

### 3. Set Railway production vars

**Option A — Railway CLI or GitHub deploy variables (preferred):**
```
gh secret list --repo IgorGanapolsky/ThumbGate
gh variable list --repo IgorGanapolsky/ThumbGate
```

If Railway CLI auth works, set variables with `railway variables set`.
If Railway CLI reports `invalid_grant`, use the GitHub PR/deploy path and the
Railway dashboard in Chrome. Do not direct-push to `main`; use a focused branch,
PR, required checks, and branch-protected merge.

**Option B — Chrome (if MCP not authenticated):**
- Navigate to railway.com dashboard
- Click into the ThumbGate project → production service
- Go to Variables tab
- Add/update each key-value pair
- Railway auto-redeploys on variable change

### 4. Verify

```bash
# Local: run Plausible poller
npm run social:poll:plausible

# Production: check instrumentation scripts and health
curl -fsS https://thumbgate.ai/health
curl -fsS https://thumbgate.ai/checkout/pro | grep -E 'plausible|posthog|G-[A-Z0-9]+'
```

## Current values (last updated 2026-05-26)

- Plausible site: `thumbgate-production.up.railway.app`
- PostHog project: US Cloud, project ID 299775
- GA4: use `THUMBGATE_GA_MEASUREMENT_ID` when present; do not assume the dashboard is export-ready without provider credentials.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.