Questions tagged [google-analytics-api]
A set of APIs for building custom reporting solutions and programmatically managing existing Google Analytics accounts and users.
4,372
questions
0
votes
0
answers
5
views
I encountered issues with the embedded API while retrieve analytics data, and it appears that the APIs are not compatible with GA4
I've been facing challenges with the embedded API for Google Analytics while trying to fetch data for GA4.
Despite attempting to adapt UA API calls using the GA4 query explorer, the process seems ...
0
votes
0
answers
9
views
can implement GoogleCredential.FromFile(file.json) when debugging but not after publishing
I'm trying to get data from Google Analytics through Data API v1Beta and it works properly until I publish the project(web application).Everything works fine except for a line that GoogleCredential....
0
votes
0
answers
14
views
Google Analytics Admin API - How to create audience that using sequenceFilter?
I used the "Try this method" on this page.
https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/properties.audiences/create
And it seems that it always return 400 ...
0
votes
0
answers
23
views
GA4: Data API Data disappearing for large date ranges
I am trying to get data of users and average session duration for specific hostName which can change for every site that is deployed on our subdomain. I used the below request but issue is if a ...
0
votes
0
answers
17
views
GA4: Data API - Managing Reporting
I am trying to get data of users and average session duration for specific hostName which can change for every site that is deployed on our subdomain. I used the below request but issue is if a ...
1
vote
1
answer
49
views
GA4 Reports Builder for Google Analytics - How to make a Filter?
GA4 Reports Builder
I'm having a problem understanding how to make a filter in a report.
Basically I want to get only data from "facebook / cpc" in a report, but following the guides from ...
0
votes
1
answer
45
views
Google Analytics 4 Data API Item Scope
Dimension fields from user and custom events in Google Analytics via Python
user event-->name:"customUser:x_id"
custom event-->name:"customEvent:x_id"
I can get it as, but ...
-1
votes
0
answers
12
views
PHP Google Analytics API not returning correct values for same date periods
I'm using Analytics Reporting API to get analytics data.
my dimensions and metrics are respectively ga:medium and ga:users
However when I'm getting data from the API for different date periods
count ...
-2
votes
0
answers
17
views
Google Analytics Data API (GA4) can't get Pmax campaign data [closed]
Google Analytics Data API (GA4) can't get Pmax campaign data,
other series can be used normally
0
votes
1
answer
32
views
Problems to extract data with JSON from API Google Analytics
in this days I worked with API from Google Analytics for extract data to my DataLake using DataFactory; but, on the JSON generation page I can´t put two filters for my dimensions, when I write the ...
0
votes
1
answer
46
views
How to Covert Google analtics API response to Pandas data frame
I have some code which exports data from Google analytics using the Google Analtics data api.
def sample_run_report(credentials=None, property_id="YOUR-GA4-PROPERTY-ID"):
"""...
0
votes
0
answers
23
views
Adding custom dimensions in GA4 means event count decreases
When I add a custom dimension to an exploration checking pdf downloads the event count decreases. The custom dimension provides information on what unit the pdf download was for and you can see some ...
0
votes
0
answers
31
views
Google Analytics Data API (GA4) in R - Filters with "IF" statement
I want to get data from GA Data API (GA4) in R using ga_data_filter:
ga_query <- tryCatch({ga_data(ga_id[i],
dimensions = c("yearMonth", "Country", "sessionSourceMedium&...
0
votes
0
answers
27
views
How to add multiple filter using GAPandas4 for Google Analytics Data API
I've been working in this project to extract data from GA4 with GAPandas4 but I need to add one extra filter, have tried some options but didn't work it out.
Have someone did it previously? How can I ...
0
votes
0
answers
32
views
Manage user permission Google Analytics API v3
I'm using the Google Analytics API to add users to a Google Analytics account.
I'm using the following POST endpoint to do so.
https://www.googleapis.com/analytics/v3/management/accounts/${accountID}/...
1
vote
1
answer
194
views
API route not found on NextJS 14 (App/route)
I want to use the Google Analytics API using SWR on Next.js 1, however the route returns 404.
const { data: visitors } = useSWR("/api/dash/route", fetcher);
My folders tree:
app/analytics/...
0
votes
0
answers
21
views
Google GA4 API - Including "totalUsers" metric changes number of rows returned
I'm trying to get some data from Google Analytics GA4 API and I noticed that when I include or exclude the "totalUsers" metric, it changes the number of rows returned by a huge amount. I was ...
0
votes
1
answer
57
views
I have issues with Google Analytics Data API (GA4) in .NET
I have a problem, I can't get the call to analytics to work with the example from this documentation ( Quick start ). I've changed some things I've read, since it doesn't allow me to use the example ...
1
vote
0
answers
25
views
localItemPrice in Google Analytics Data API
Is localItemPrice available via the Google Analytics Data API, or is it something that will be released soon?
localItemPrice is a field that exposed in the Google Analytics explorer UI, but it is not ...
0
votes
0
answers
46
views
Google Analytics Data API v1 Error 403 with access token (Nodejs)
I am trying to access data from my users' Google Analytics 4 accounts using oauth authentication, with their access token. So far I have been accessing their Universal Analytics data and have had no ...
1
vote
1
answer
20
views
Get unique add to cart from GA v4 API
Using GA data analytics API, we can get "addToCarts" metric
However that's total add to carts
On GA web, we can see total add to cart events and also total users that added to cart:
enter ...
0
votes
1
answer
33
views
ga4 mapping (ga:entrances, ga:bounces, ga:pageLoadTime, ga:pageLoadSample)
I did not find what the following universal analytics parameters are replaced with:
universal analytics -> ga4 :
ga:entrances -> ?
ga:bounces -> ?
ga:pageLoadTime -> ?
ga:...
0
votes
0
answers
20
views
Google Ads - Is the campaign_criterion.criterion_id the same as geographic_view.country_criterion_id?
Just like the title, I am migrating from Adwords to Google Ads. I want to know the Total Google Ads Cost (365 days) based on the country name.
Hence, I need to know whether the criterion_id from ...
1
vote
1
answer
65
views
GA4 API and Query Explorer vs Analytics Dashboard Metric and Dimension mis-matched
I am trying to fetch the information using GA4 API and Query Explorer and matching the same with the GA4 Dashboard.
While doing so I am seeing that there is a significant difference in Dimension and ...
0
votes
0
answers
42
views
Extraction of specific report in GA4 (Google Analytics 4)
I am trying to use GA-4 and extract data. In the console, I can find multiple reports created with different names. All of the reports have the same "Metrics" and "dimensions". I ...
0
votes
1
answer
59
views
How to combine values from different arrays of object into an array
I want to capture the parameter Unassigned with value 64314 from the API output. My objective is to capture this information in an array such as ['Unassigned',64314]
I used this for-in loop to achieve ...
0
votes
0
answers
79
views
Can't connect GA4 properties with Custom Channel Group using Power BI connector
I have discovered an issue in GA connector (2.0 implementation) for Power BI. I can't connect GA4 properties with Custom Channel Group using Power BI connector, I get the exception above:
Expression....
0
votes
0
answers
35
views
Fetch raw data from google analytics without GA4 and UA
I am facing issues using Google Analytics APIs (GA4 & UA). First, UA provided historical data till 07-2023 and GA provided data from 06-2023. So I can't use one of them alone. This leads to ...
0
votes
0
answers
63
views
Setting up Google Analytics 4 for an Electron App
I'm currently trying to set up some sort of analytics solution for an Electron app that I'm working on. I'm currently leaning toward using a solution like this:
https://www.npmjs.com/package/electron-...
0
votes
0
answers
28
views
Google Analytics Data API only returns Google Ads campaigns with clicks
I´m trying to use the Google Analytics Data API to download Google Ads data (impressions, clicks, cost) per campaign for a given week. When I compare the data that I get from the API with the data ...
0
votes
1
answer
39
views
How to use many dimensionFilter in Spatie Laravel Analytics?
This example 2 Filters
When i use this 2 filter structure,and what happends is that only the last filter is read by system / eventName
`$data = Analytics::get(
period: Period::create($startDate, $...
2
votes
1
answer
65
views
google analytics 4 api dimension restricting metrics
i'm trying to get the following metrics
new Metric { Name = "sessions" },
new Metric { Name = "engagedSessions" },
new Metric { Name = "conversions&...
0
votes
0
answers
10
views
Why does the eventCount change when adding or removing metrics in the page-view event in GA4?
I want to know how many page-views have occurred for every page on our client's website. I was wondering if there is someone who could explain why these two requests might change the results in GA4. ...
1
vote
1
answer
58
views
Mobile device by measurement protocol GA4 [closed]
as you know, measurement protocol in GA4 is very limited. i have problem with tracking events from mobile devices in measurement protocol - at my reports there is only 'desktop'. I saw many ...
1
vote
0
answers
40
views
Google Analytics 4 API totals increase when filtering data further (page path and medium)
I am querying the Google Analytics 4 API for data regarding Sessions. In a given scenario, I filter the data with the "unifiedPagePathScreen" filter set to "contains blog" (my ...
3
votes
1
answer
131
views
Migrate Google Analytics Embed API to GA4
I have a dashboard based on the Google Analytics Embed API (javaScript library) to present charts inside my platform with Analytics UA results from my website. Basically, I was reading properties like ...
0
votes
0
answers
54
views
userActivity.search in Google Analytics Data API v1
I was using userActivity.search method in Google Analytics Reporting API v4 by providing a UserID (ga cookie). Is there any similar way in the new GA Data API?
In Google Analytics GA 4>Explore>...
1
vote
0
answers
52
views
I'm having trouble migrating from Universal Analytics (v3) to Google Analytics v4
I have a PHP application that collects data from Universal Analytics, but now there's no more data, and I need to retrieve data from GA4. I've tried to update the functions according to the ...
0
votes
0
answers
90
views
PERMISSION_DENIED: Request had insufficient authentication scopes. | GCloud Analytics API | Ubuntu | NodeJS
I am working with Google Analytics API. My code is working locally. But it is not working on the Ubuntu Server instance. I have checked and done the following steps correctly:
ADC is signed in using ...
0
votes
0
answers
78
views
Google Analytics v1 Beta RunReportRequest Object reference not set to instance error
I am using c# to retrieve a report from Google Analytics (GA4) using Google.Apis.AnalyticsData.v1beta. Following an example from https://developers.google.com/analytics/devguides/reporting/data/v1/...
0
votes
0
answers
40
views
What are the methods for extracting raw GA4 data no row limits?
We are interested in downloading raw (non-aggregated) GA4 data.
I'm aware of 4 methods for extracting GA4 data:
Reports
Explorations
Analytics Data API
BigQuery Export
The only method that I know of ...
0
votes
0
answers
37
views
How can I accurately track conversions with Google Analytics 4 (api)?
I run a small webapp. The app is hosted on app.mydomain.com and is custom built with React. My 'main' website is just on mydomain.com. This is a Wordpress website that mainly drives the traffic with a ...
1
vote
2
answers
164
views
GA4 conversion/purchase tracking using Measurement Protocol results in source/medium "not set"
I'm trying to send purchases to GA4 using the Measurement Protocol API.
Here ist my request:
https://www.google-analytics.com/mp/collect?measurement_id=G-xxxxxxxxxx&api_secret=...
0
votes
0
answers
69
views
How to get all detail data click Google Analytics GA4 using api in php?
In my case im using spatie/laravel-analytics laravel 10, this my code
$data = Analytics::get(
period: Period::days($day),
metrics: ['eventCount'],
dimensions: ['...
0
votes
0
answers
50
views
Fetching data from Google analytics GA4 api in rails
This has probably something to do with recent migration to GA4, but for some reason my previous code stopped working and now I have problems with fetching basic data.
I think now I need to use ...
2
votes
2
answers
39
views
What is the equivalent for ga:screenDepth in the GA4 data api?
I could not find any dimension to get the screen depth for my app. I checked here . Could not find it. It's not there even in GA4 UI .
0
votes
0
answers
19
views
Numbers retrieved from the API and numbers on the screen are different
I used the API to retrieve data from a property with Google Signals enabled and thresholds applied.
I can view the values on the GA4 screen, but when I use the API to retrieve the data, there is no ...
2
votes
1
answer
117
views
PHP BetaAnalyticsDataClient runRealtimeReport empty
If I try the following it ends up empty -- Even though when I log into GA Analytics it will show 2 or 3 current active users in the last 30 mins. (which is the data I am trying to get back)
use Google\...
0
votes
0
answers
36
views
GA4 Data API - compound dimension filters on audienceName field are ineffectual
Problem
I'm using the GA4 Data API v1beta via the Node.js client library (googleapis package). Specifically, I'm hitting the runReport endpoint.
I'm running into an issue where compound (e.g. orGroup) ...
0
votes
0
answers
64
views
Google Analytics 4 PHP library not returning any property list
Why is the Google Analytics 4 PHP library not returning any property list even though I have enabled Google Analytics permissions in my service account.
$properties=$analytics>...