GA4 API to Big Query: Custom Reports doesn't work

Some of my info:

  • Is this your first time deploying Airbyte?: Yes
  • OS Version / Instance: Windows
  • Memory / Disk: 16Gb / 1 Tb
  • Deployment: Docker
  • Airbyte Version: 0.40.3
  • Source name/version: Google Analytics Data API ALPHA 0.0.3
  • Destination name/version: Big Query
  • Step: Creating connection
  • Description: When I use Custom Reports (Optional), I got an error name “Failed to fetch schema”
    When I don’t use Custom Reports, then the connection works fine but returning only some daily active users data (which isn’t what I’m looking for).

The log is below, so hope that somebody can help:

* 2022-09-08 08:18:27 ERROR i.a.w.i.DefaultAirbyteStreamFactory(internalLog):95 - string indices must be integers
* Traceback (most recent call last):
*   File "/airbyte/integration_code/main.py", line 13, in <module>
*     launch(source, sys.argv[1:])
*   File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 123, in launch
*     for message in source_entrypoint.run(parsed_args):
*   File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 108, in run
*     catalog = self.source.discover(self.logger, config)
*   File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 73, in discover
*     streams = [stream.as_airbyte_stream() for stream in self.streams(config=config)]
*   File "/airbyte/integration_code/source_google_analytics_data_api/source.py", line 370, in streams
*     return [
*   File "/airbyte/integration_code/source_google_analytics_data_api/source.py", line 371, in <listcomp>
*     type(report["name"], (GoogleAnalyticsDataApiGenericStream,), {})(
* **TypeError: string indices must be integers**
* 2022-09-08 08:18:27 INFO i.a.w.t.TemporalAttemptExecution(get):131 - Stopping cancellation check scheduling...

Here is the full log
log.txt (2.2 KB)

Can you share the custom report you’re trying to create?

1 Like

Sure! Thanks for at least replying :smiley: :smiley:
I just try to create a simple revenue report

screen_shot

Here is the code I typed in Custom Reports:
**

  • {“name”: “Test-revenue”, “dimensions”: [“date”], “metrics”: [“activeUsers”, “averageRevenuePerUser”, “totalAdRevenue”, “totalPurchasers”, “totalRevenue”]}

The custom report must be:

[{"name": "Test-revenue", "dimensions": ["date"], "metrics": ["activeUsers", "averageRevenuePerUser", "totalAdRevenue", "totalPurchasers", "totalRevenue"]}]

An array of JSON objects.

1 Like

Really appreciate, it works

Hi Marcosmarxm,
Can I have another question. Hope that you can help me out.
What is the impact of “Data request time increment in days” on data?
Does it relate to Analytics Property Quotas, especially Core Tokens Per Property Per Day (25000)?

When I put 1 in “Data request time increment in days”, and start date = 2022-08-25, and then choose sync mode as

  • Source: Incremental
  • Destination: Deduped + history

Is there any difference with

  • Data request time increment in days : 364
  • Source: Incremental
  • Destination: Deduped + history

I tried to google it, but still cannot understand clearly

yes, Data request time increment in days (Optional) - The time increment used by the connector when requesting data from the Google Analytics API. More information is available in the the docs. The bigger this value is, the faster the sync will be, but the more likely that sampling will be applied to your data, potentially causing inaccuracies in the returned results. We recommend setting this to 1 unless you have a hard requirement to make the sync faster at the expense of accuracy. The minimum allowed value for this field is 1, and the maximum is 364. (e.g. 30, 60, 90, 120, 200, 364)

this parameter is used to sample data. using 1 will bring daily records using 364 will be much less rows, but will group them.

1 Like