Analytics and ads

Google Analytics

Connect one GA4 property to a workspace so your agent can read its reports: what it reads, what uplika stores, and how to disconnect.

What does connecting Google Analytics do?

It lets your agent read the reports of one GA4 property and answer questions about them. It only reads. Nothing changes in Google Analytics, and nothing gets published.

How do I connect a GA4 property?

  1. Open Connections in a workspace

    Pick the workspace first. The property belongs to that workspace.

  2. Press New connection, then Google Analytics

    It is in the Analytics and ads group, below the channels. Then press Connect Google Analytics.

  3. Allow access on Google's screen

    Use a Google account that can view the property, and leave the Analytics box checked.

  4. Pick the property

    If the account can view only one property, it connects right away. Otherwise pick one from the list.

What can my agent ask?

Ask in plain words, such as which sources brought the most sessions in the last 7 days. Your agent can run reports over date ranges, read realtime figures, and look up the dimension and metric names the property has, including custom ones.

A report can be up to 10 minutes old, because uplika keeps it in memory that long. Google limits how much each property can be read, and your agent sees what is left in each reply.

Can I call these reads over REST?

Yes. The three tools call these routes, and an API key with posts:read can call them too. Send x-uplika-workspace when you have more than one workspace; the property is the one connected to it. Names are Google's API names. A field the route does not take, or a name the property does not have, comes back as analytics_bad_request with the reason.

POST/v1/integrations/google_analytics/report

Run a report over date ranges. Same as get_analytics_report.

NameTypeDescription
metricsRequiredstring[]Metric names, such as sessions or activeUsers.
dimensionsstring[]Dimension names, such as sessionSource or date.
dateRangesobject[][{ startDate, endDate, name? }]. Dates are YYYY-MM-DD, today, yesterday or NdaysAgo. Omit for the last 28 days up to yesterday.
dimensionFilterobjectGoogle's FilterExpression, over dimensions.
metricFilterobjectGoogle's FilterExpression, over metrics.
orderBysobject[]Google's OrderBy objects.
limitnumberRows to return.
offsetnumberRows to skip, for the next page.
keepEmptyRowsbooleanKeep rows whose metrics are all zero.
currencyCodestringThree-letter ISO 4217 code, such as USD.

POST/v1/integrations/google_analytics/realtime

Realtime report for the last 30 minutes (60 on Analytics 360), never cached. Same as get_analytics_realtime.

NameTypeDescription
metricsRequiredstring[]Metric names, such as activeUsers.
dimensionsstring[]Dimension names, such as country.
dimensionFilterobjectGoogle's FilterExpression, over dimensions.
metricFilterobjectGoogle's FilterExpression, over metrics.
orderBysobject[]Google's OrderBy objects.
limitnumberRows to return.
minuteRangesobject[][{ startMinutesAgo, endMinutesAgo }]. 0 is now. Omit for the whole window. dateRanges and offset are refused here.

GET/v1/integrations/google_analytics/metadata

The metric and dimension names this property can report on, custom ones included. Same as get_analytics_metadata.

What does uplika store?

uplika stores what it needs to keep the connection: the encrypted tokens, the property's id and name, the name of the account it sits in, its time zone and currency, and your Google account id. They stay until you disconnect, or delete the workspace or your account.

Reports are never written to our database. They stay in the server's memory for up to 10 minutes, lists of dimension and metric names for up to 1 hour, and realtime figures are not held at all. uplika does not sell this data or use it for advertising.

Why did connecting fail?

What you seeWhat to do
You cancelled on Google's screen. Nothing was connected.Start again and allow access on Google's screen.
uplika needs permission to view your Analytics data. Leave that box checked.Start again and leave the Analytics box checked.
This Google account cannot view any GA4 property.Use a Google account that can open a GA4 property in Google Analytics, or ask its administrator to add you.
Google did not give lasting access. Remove uplika in your Google Account and connect again.Open your Google Account permissions, remove uplika, then connect again.
That connection link expired. Start again.A connection link lasts up to an hour. Start again from Connections.
This connection was started from another uplika account, or you are signed out. Sign in and start again from Connections.Finish in the browser where you started, signed in to the same uplika account. Do not use a connection link someone sent you.
Google did not finish the sign-in. Try again.Start again from Connections.

How do I disconnect?

Press Disconnect on the card. uplika deletes the stored tokens and asks Google to end its access, unless the same Google account is still connected elsewhere in uplika. You can also cut uplika off from your Google Account at any time.

Frequently asked

Can my agent change anything in Google Analytics?

No. uplika asks Google for read-only access, so it cannot change settings, data or users in the property.

Can I connect more than one property?

One property per workspace. To read another property as well, connect it in another workspace.

What happens if I connect a different property?

It replaces the current one in that workspace. uplika shows both names and asks you to confirm first.