Analytics access: Rufus's one sitting (20 min)
Analytics access: Rufus's one sitting (~20 min)
Bead marketing-861.28.5 (T4). Prepared by T3. Everything here is read-only access, revocable from each Google account's "Third-party access" page. Paste nothing secret into chat; the commands write tokens to files under ~/.config/.
Accounts: A = rufus@lifeitself.org (main), B = rufus.pollock@datopian.com, C = rufus@rufuspollock.com (Atomatic GA account; rufuspollock.com for now).
Already done by the agent: gcloud installed; Twenty read access works (~/.config/twenty/apikey, shared workspace key); OAuth desktop client exists at ~/.config/gws/client_secret.json in Cloud project gws-rufus.
1. Check the OAuth client (1 min, browser)
Open https://console.cloud.google.com/auth/audience?project=gws-rufus (signed in as B).
- If User type = Internal: only datopian.com accounts can use it. Switch to External.
- If Publishing status = Testing: click Publish app (to "In production"). This stops tokens expiring after 7 days. Google will show an "unverified app" warning at login; that is expected for your own client.
2. Enable the APIs (1 min, terminal)
gcloud auth login rufus.pollock@datopian.com
gcloud services enable analyticsdata.googleapis.com analyticsadmin.googleapis.com searchconsole.googleapis.com --project gws-rufus
Let account A (and C) bill API quota to this project:
gcloud projects add-iam-policy-binding gws-rufus --member=user:rufus@lifeitself.org --role=roles/serviceusage.serviceUsageConsumer
gcloud projects add-iam-policy-binding gws-rufus --member=user:rufus@rufuspollock.com --role=roles/serviceusage.serviceUsageConsumer
3. One read-only login per account (2 min each, browser consent + 2FA)
Each account gets its own folder, so logins do not overwrite each other.
Use scripts/google_login.py, which asks only for Analytics and Search Console read-only. Do not use gcloud auth application-default login: it always adds the cloud-platform scope, and the lifeitself.org Workspace's "Google Cloud session control" then kills the token within days (invalid_rapt, seen 21 Oct 2026).
python3 scripts/google_login.py lifeitself --hint rufus@lifeitself.org
python3 scripts/google_login.py datopian
python3 scripts/google_login.py rufuspollock
Pick the matching account in the browser each time. Then tell the agent "done"; it sets the quota project and runs the access test (T5).
4. Two quick answers (type in chat)
- Weekly summary day (e.g. Monday morning).
- (Answered 17 Oct: summary on Wednesday; account C is rufus@rufuspollock.com.)
If something fails
Note the error and move on; the agent will sort it out. Most likely: "app blocked" (step 1 not done), or "permission denied" on quota (step 2's last command).