How to connect ClearFlowCMS to Google Analytics for metrics on dashboard
In Google Cloud (console.cloud.google.com)
- Project: use the project picker at the top left → New project. Any name works, e.g. "Website statistics" → Create, and make sure it's selected.
- Turn on the API: ☰ menu → APIs & Services → Library. Search for Google Analytics Data API, open it and click Enable. Not "Google Analytics API" or "Admin API": it has to be the Data API.
- Service account: ☰ menu → IAM & Admin → Service accounts → + Create service account.
- Name it, e.g. statistics, then click Create and continue.
- Skip the roles step (no roles are needed) and click Done.
- Key file: click the new service account → Keys tab → Add key → Create new key → JSON → Create. A .json file downloads. That's the file ClearFlow asks for. Treat it like a password.
- Copy the service account's email address. It looks like statistics@website-statistics-123456.iam.gserviceaccount.com.
In Google Analytics (analytics.google.com)
Select the property of the website you want stats for. Then Admin (gear, bottom left) → Property access management → + → Add users. Paste the service account's email, choose the role Viewer, untick "Notify new users by email" and click Add.
Property ID: in Admin → Property details (or Property settings), the Property ID is a number of about 9 digits at the top right. It's not the G-… Measurement ID.
In ClearFlow
Go to Settings → Visitor statistics. Fill in the Property ID, choose the .json file and click Save. It asks Google straight away and either confirms the connection works or says what's missing.