google-analytics-api

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK' Question: So recently I had to reinstall python due to corrupt executable. This made one of our python scripts bomb with the following error: AttributeError: module ‘lib’ has no attribute ‘X509_V_FLAG_CB_ISSUER_CHECK’ The line of code that caused it to bomb was: from apiclient.discovery import build I tried pip …

Total answers: 14

Different report results between Google Analytics 4 UI and Google Data API data

Different report results between Google Analytics 4 UI and Google Data API data Question: I have a list of customers set in GA4 and I am using the google API analytics for GA4 to retrieve daily the traffic metrics for reporting purposes. Checking the metrics day by day, I noticed a lot of differences in …

Total answers: 1

Google Analytics Internal Server Error 500

Google Analytics Internal Server Error 500 Question: I am trying to build an API call to retrieve google analytics data. This API call was working and now it returns the error : <HttpError 500 when requesting https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json returned "Internal error encountered.". Details: "Internal error encountered."> So the body of the code I got was from …

Total answers: 1

Oauth redirects to localhost when hosted on server

Oauth redirects to localhost when hosted on server Question: I hope you can help. This script works locally for Google Analytics Auth, but when I put it on my server & run it with python3 xxx.py and go to the auth URL it redirects to localhost, which fails because it’s on the server. Does anyone …

Total answers: 1

Requested 10 dimensions; only 9 are allowed on Google Analytics Core Reporting API4

Requested 10 dimensions; only 9 are allowed on Google Analytics Core Reporting API4 Question: I have been trying to call Google Analytics core reporting v4 to get basic traffic data, but I could never get default channel grouping/channel grouping from the API. However, the dimension is available according to their metric and dimension explorer. from …

Total answers: 1

BigQuery | Python | Export data from BigQuery table VIEW

BigQuery | Python | Export data from BigQuery table VIEW Question: This is a simple code to export from Biq Query to Google storage, in CSV format def export_data(): client = bigquery.Client() project = ‘xxxxx’ dataset_id = ‘xxx’ table_id = ‘xxx’ bucket_name = ‘xxx’ destination_uri = ‘gs://{}/{}’.format(bucket_name, ‘EXPORT_FILE.csv’) dataset_ref = client.dataset(dataset_id, project=project) table_ref = dataset_ref.table(table_id) …

Total answers: 2

invalid_client: The OAuth client was not found. Python

invalid_client: The OAuth client was not found. Python Question: I have an old project, that is trying to retrieve data from google analytics. It is not working, so I am trying to figure out what’s wrong. Found an example code to work with Analytics on server side. scope = [‘https://www.googleapis.com/auth/analytics.readonly’] key_file_location = ‘secrets.json’ credentials = …

Total answers: 1