Google Analytics
Run GA4 reports, pivot, batch and realtime reports, and audience exports, for any property you can read.
A Google Analytics connection gives a playbook's functions the Google Analytics Data API, from a document Auto ships, so a function reads the same reports you build in the GA4 interface, as you, for every property your Google account can read. A second provider, Google Analytics Admin, reads the accounts, properties, data streams, custom dimensions and metrics and key events behind those reports, and runs data access reports; it changes nothing.
Google Analytics is available on Auto Cloud and on self-hosted runtimes. Google Analytics Admin: on Auto Cloud, available once Google's review of Auto completes; on a self-hosted runtime, with your own Google Cloud project, now.
What a playbook can do with Google Analytics
- Run a report over any dimensions and metrics for a date range, a pivot report, a batch of reports in one call, and a realtime report of the last minutes.
- Check which dimensions and metrics go together before a report runs, and read a property's metadata.
- Create an audience export and read its rows.
- With the Admin provider: read accounts, properties, data streams, custom dimensions, custom metrics and key events, and run a data access report of who looked at what.
Nothing in a property is changed, apart from the audience export a function creates.
The tools of Google Analytics, as the connection lists them
Tools that read: analyticsdata.properties.runReport, analyticsdata.properties.runPivotReport, analyticsdata.properties.batchRunReports, analyticsdata.properties.batchRunPivotReports, analyticsdata.properties.runRealtimeReport, analyticsdata.properties.checkCompatibility, analyticsdata.properties.getMetadata, analyticsdata.properties.audienceExports.list, analyticsdata.properties.audienceExports.get and analyticsdata.properties.audienceExports.query.
Tools that act: analyticsdata.properties.audienceExports.create.
The tools of Google Analytics Admin, as the connection lists them
Tools that read: analyticsadmin.accountSummaries.list, analyticsadmin.accounts.list, analyticsadmin.properties.list, analyticsadmin.properties.get, analyticsadmin.properties.dataStreams.list, analyticsadmin.properties.customDimensions.list, analyticsadmin.properties.customMetrics.list, analyticsadmin.properties.keyEvents.list and analyticsadmin.properties.runAccessReport.
An example workflow
A monthly landing-page review. A schedule trigger starts the workflow on the first of the month. A lookup function runs one report with analyticsdata.properties.runReport: sessions, engaged sessions and key events by landing page for last month and the month before. A computation function works out the change for each page and sorts them. A reasoning function reads the table with the team's own thresholds in its prompt and writes a short note: which pages gained, which fell, and which fell while their traffic held, the ones worth a look. A prediction function can forecast next month's sessions for the top pages from the figures the playbook has recorded month after month, with a likely range. An interaction function sends the note where the team reads it, through a Slack or Outlook connection, and the whole run, each report's rows included, is in Studio.
How to connect Google Analytics
Google Analytics
- Sign in to Google and allow Google Analytics reporting. The consent screen shows the permissions listed below.
Google Analytics Admin
- Sign in to Google and allow Google Analytics administration. The consent screen shows the permissions listed below.
Then:
- Ask your agent to connect Google Analytics to Auto, or open Settings, Agents, Connections in Auto Studio and choose Google Analytics or Google Analytics Admin. On Auto Cloud, Studio lists Google Analytics Admin once Google's review of Auto completes.
- On the Studio page, check the service and its access, choose which playbooks may use the connection, and approve it.
- Have your agent check one small read through the connection before a function depends on it.
What it needs
- A Google account with at least Viewer access to the properties the playbook reads. The connection reads what you can read.
- Your agent connected to Auto and signed in as you, with permission to change your organization, if your agent adds the connection.
- On a self-hosted runtime, a Google Cloud project of your own with the Analytics Data API, and for the Admin provider the Analytics Admin API, enabled and an OAuth client registered for the runtime, as Let people add connections sets out.
Both providers ask the one scope analytics.readonly, and no other.
Permissions Auto asks for
Google Analytics and Google Analytics Admin:
- See and download Google Analytics data.
Good to know
A report's rows are kept in the run's history, where people with access to the playbook can read them, unless the connection is added with content recording off. GA4's own quotas apply: a workflow that runs many reports an hour against one property meets them as the GA4 interface would. The Admin provider is a connection of its own, added separately, so a playbook that only reports does without it.