GA4 Data API: How to Pull Conversion Data Programmatically
The GA4 Data API lets you pull conversion data automatically instead of exporting CSVs every month. Here is how it works, what you get back, and why it matters for agencies.
If your agency manages 10 brands, you log into GA4 ten times a month. You set the date range. You export the CSV. You copy numbers into a spreadsheet. You do this every month, for every brand, without fail.
The GA4 Data API eliminates all of that. It lets your software pull conversion data directly from GA4 — no CSVs, no manual exports, no copy-paste errors. For manual GA4 setup, see [setting up GA4 for accurate conversion tracking](/blog/setting-up-ga4-for-accurate-conversion-tracking).
What Is The GA4 Data API
The GA4 Data API is a programmatic interface that lets external software request data from your Google Analytics 4 property. Instead of a human logging in, clicking "Export," and downloading a CSV, a server sends a request to Google and gets the data back automatically.
The API is officially called the "Google Analytics Data API v1beta." The "v1beta" tag means it is still technically in beta, but it has been stable and production-ready for over two years.
What Data Can You Pull
The GA4 Data API gives you access to almost everything you see in the GA4 dashboard, structured as rows and columns.
Conversions
You can pull conversion counts for any event you have marked as a conversion in GA4. You can filter by date range, by event name, by source/medium, by campaign, and by landing page.
Sessions and Users
The API returns session counts, user counts, and new user counts. You can break these down by channel, by device, and by geography.
Revenue
If your client has e-commerce tracking set up, the API returns purchase revenue, average order value, and items per transaction.
Custom Dimensions
Any custom dimension you have configured in GA4 is accessible through the API.
What You Cannot Pull
The GA4 Data API does not give you raw event-level data. You cannot pull individual user sessions, click paths, or individual transactions. For that, you need the GA4 BigQuery export.
How Authentication Works
The GA4 Data API uses OAuth 2.0 — the same system used for Google Ads and most Google services.
- Your application redirects the user to Google's login page
- The user logs in with the Google account that has access to the GA4 property
- Google asks: "Allow this application to read your Analytics data?"
- The user clicks "Allow"
- Google sends back an access token and a refresh token
- Your application stores these tokens securely
For agencies, one OAuth connection at the agency level is enough. The agency owner's Google account should have access to all client GA4 properties.
What The API Response Looks Like
When you send a request to the GA4 Data API, you get back a structured JSON response. The response has two main parts: dimension headers and metric headers.
Dimension headers describe the categories — things like date, campaign name, source, and medium. Metric headers describe the numbers — things like conversions, sessions, users, and revenue.
Each row in the response is one combination of dimensions with its corresponding metrics. For example, if you request conversion data by campaign for the last 7 days:
| Dimension (Campaign) | Metric (Conversions) | Metric (Sessions) |
|---|---|---|
| Summer Sale 2026 | 45 | 1,230 |
| Performance Max | 78 | 2,100 |
| Brand Search | 112 | 890 |
The response also includes metadata: total row count, currency code (returns "INR" for Indian properties), and the date range the data covers.
Rate Limits And Quotas
| Limit Type | Amount |
|---|---|
| Core API requests per day | 50,000 |
| Core API requests per hour | 5,000 |
| Realtime API requests per day | 10,000 |
| Concurrent requests | 10 |
For an agency managing 10 brands with weekly and monthly reports, you will use approximately 20-40 requests per reporting cycle. You will never come close to the 50,000 daily limit.
Practical advice for agencies: Pull data once per report cycle (weekly or monthly), store it in your database, and display from the database. Do not call the GA4 API every time someone loads a page.
Setting Up The GA4 Property Selector
Each GA4 property has a numeric ID called the "property ID." You can find it in GA4 under Admin > Property Settings. It looks like "properties/123456789."
For agencies, the setup flow is:
- Agency owner connects their Google account via OAuth
- The application lists all GA4 properties the account has access to
- For each brand, the agency selects which GA4 property belongs to that brand
- The application stores the property ID mapping (brand to GA4 property ID)
This is a one-time setup. Once the mapping is stored, the API knows which property to query for each brand automatically.
Common Errors And How To Handle Them
Permission Denied
The authenticated user does not have access to the requested GA4 property. Fix: Ask the client to re-add your agency's Google account as a Viewer on the GA4 property.
Property Not Found
The property ID does not exist or has been deleted. Fix: Update the property mapping in your integrations page.
Quota Exceeded
You have hit the rate limit. Fix: Implement request batching and caching.
Invalid Date Range
GA4 Data API retains data for 14 months on standard properties. Only request data within the retention window.
Why This Matters For Your Agency
If your team manually exports GA4 data every month, the API eliminates that work entirely. For 10 brands, that is approximately 5 hours saved per month — just on GA4 exports.
But the real value is accuracy. When a human exports data, they can pick the wrong date range, miss a filter, or copy a number incorrectly. The API does the same thing the same way every time. No errors. No missed data.
Frequently Asked Questions
How do I access the GA4 Data API?
You need a Google Cloud project with the Analytics Data API enabled, OAuth 2.0 credentials, and a Google account with at least Viewer access to the GA4 property. Most agencies use a reporting tool that handles the API connection for them.
What data can I get from the GA4 Data API?
You can get conversion counts, session data, user counts, revenue data, and custom dimensions. The data can be filtered by date range, event name, source/medium, campaign, and landing page. You cannot get raw event-level data — for that you need the GA4 BigQuery export.
How much does the GA4 Data API cost?
The GA4 Data API is free. Google does not charge for API requests. There are rate limits (50,000 requests per day) but these are more than enough for agency reporting needs.
Can I pull data from multiple GA4 properties in one request?
No. Each API request targets one GA4 property. For agencies managing multiple clients, you need to make separate requests for each property. Most tools batch these requests automatically.
How ADsHisaab Uses The GA4 Data API
ADsHisaab connects to the GA4 Data API once during onboarding. For each brand, the agency selects which GA4 property to pull from. After that, ADsHisaab pulls conversion data automatically on schedule — weekly on Wednesdays and monthly on the 3rd.
The data flows into the brand analytics dashboard where it sits alongside Google Ads and Meta Ads numbers. GA4 is marked as "Ground Truth" and the discrepancy percentages are calculated automatically.
Try it free at adshisaab.com
ADsHisaab automates ad reporting for Indian agencies. Reconcile Google Ads, Meta Ads, and GA4 numbers automatically.
Try ADsHisaab free