I'm using `tap-ga4` and this is how my configurati...
# troubleshooting
t
I'm using
tap-ga4
and this is how my configuration looks like:
Copy code
{
  "end_date": "2023-12-15",
  "key_file_location": "./keys/client_secrets.json",
  "property_id": "420038723",
  "reports": "./reports/report.json",
  "start_date": "2023-12-31"
}
When I'm running
meltano config tap-ga4 test
I get this error:
Copy code
Plugin configuration is invalid
{"type": "SCHEMA", "stream": "users_per_day", "schema": {"properties": {"date": {"type": ["string"]}, "activeUsers": {"type": ["integer", "null"]}, "report_start_date": {"type": ["string"]}, "report_end_date": {"type": ["string"]}}, "type": "object", "required": ["date", "report_start_date", "report_end_date"]}, "key_properties": ["date"], "bookmark_properties": ["date"]}
This is how my
report.json
file looks like:
Copy code
[
  { "name": "users_per_day",
    "dimensions":
    [
      "date"
    ],
    "metrics":
    [
      "activeUsers"
    ]
  }
]
Can anyone please tell me what could have gone wrong?
r
What's the output if you run
meltano --log-level debug config tap-ga4 test
?
t
@Reuben (Matatika) sorry for the long output. This is too long so I'm going to attach a txt file instead for you to see.
r
Looks to me like your just not getting any data back (no
RECORD
messages). Have you tried loosening your
select
criteria?
t
@Reuben (Matatika) Two things I must mention: 1. My website (where I installed Google Analytics) is pretty new. I visited to generate some visits. Not sure if that makes any difference. 2. I honestly don't understand
select
criteria. This is what I have in my `meltano.yml`:
Copy code
- name: tap-ga4
    variant: meltanolabs
    pip_url: git+<https://github.com/MeltanoLabs/tap-google-analytics.git>
    config:
      end_date: '2023-12-15'
      start_date: '2023-12-31'
      reports: ./reports/report.json
Does it require any other configuration?
r
Ah, sorry - I assumed you were working with select because of some lines in the debug log (probably auto-generated). Sounds like a no data in Google Analytics issue then, for whatever reason. Some other things to try:
Copy code
meltano invoke tap-ga4 > tap.out
and look for
RECORD
messages in
tap.out
, or
Copy code
meltano install loader target-jsonl
meltano run tap-ga4 target-jsonl
and see if you get any data as
.jsonl
files under
output/
. Note that there are some current issues with `meltano config tap test`: • #8307 (could be obfuscating some useful error output) • #8212 (if you are on Windows)
āœ… 1
p
@taeef_najib I agree with Reuben that its probably producing no data so its saying the config is invalid. It looks like youre end_date is before your start date so its probably not actually making any API requests right now.
šŸ™Œ 1
āž• 1
t
Guys I was putting the end date which is less than the start date. Thank you for pointing that out @Pat Nadolny (Arch) and thank you, @Reuben (Matatika), for letting me check if the record is found. It's returning the record when I run
meltano invoke tap-ga4 > tap.out
Copy code
{"type": "SCHEMA", "stream": "users_per_day", "schema": {"properties": {"date": {"type": ["string"]}, "activeUsers": {"type": ["integer", "null"]}, "report_start_date": {"type": ["string"]}, "report_end_date": {"type": ["string"]}}, "type": "object", "required": ["date", "report_start_date", "report_end_date"]}, "key_properties": ["date"], "bookmark_properties": ["date"]}
{"type": "RECORD", "stream": "users_per_day", "record": {"date": "20231215", "activeUsers": 3, "report_start_date": "2023-12-01", "report_end_date": "2023-12-30"}, "time_extracted": "2024-01-08T16:35:19.245808+00:00"}
{"type": "RECORD", "stream": "users_per_day", "record": {"date": "20231216", "activeUsers": 2, "report_start_date": "2023-12-01", "report_end_date": "2023-12-30"}, "time_extracted": "2024-01-08T16:35:19.246051+00:00"}
{"type": "RECORD", "stream": "users_per_day", "record": {"date": "20231217", "activeUsers": 2, "report_start_date": "2023-12-01", "report_end_date": "2023-12-30"}, "time_extracted": "2024-01-08T16:35:19.246208+00:00"}
{"type": "RECORD", "stream": "users_per_day", "record": {"date": "20231229", "activeUsers": 1, "report_start_date": "2023-12-01", "report_end_date": "2023-12-30"}, "time_extracted": "2024-01-08T16:35:19.246351+00:00"}
{"type": "STATE", "value": {"bookmarks": {"users_per_day": {"replication_key": "date", "replication_key_value": "20231229"}}}}
Now I'm getting:
Plugin configuration is valid
thank you!
šŸŽ‰ 2
r
Good spot @Pat Nadolny (Arch) šŸ˜…
šŸ™Œ 1