Hi everyone, I've been trying to set up the `tap-g...
# documentation
a
Hi everyone, I've been trying to set up the
tap-ga4
extractor, but I'm having trouble with configuring the client secrets: Meltano Tap-GA4 Extractor. My questions are: 1. Is it possible to use service account credentials instead of OAuth credentials? 2. If so, which configuration setting enables this? I attempted to pass a service account JSON (exported from GCP) as the value for the
client_secrets
setting in the
tap-ga4
configuration, but I received "Failed to set value" errors for each parameter. I would appreciate any help, or better - an example of the config file for a working extractor using GCP service account credentials.
a
How are you passing the json? I am using this tap successfully with json credentials, but I have
Copy code
- name: tap-ga4
    variant: meltanolabs
    pip_url: 
      git+<https://github.com/MeltanoLabs/tap-google-analytics.git@da49600d08caf614ec8336367a3b3d8f92b26100>
    config:
      start_date: 2023-03-20
      property_id: ${TAP_GA4_PROPERTY_ID}
      client_secrets: ${TAP_GOOGLE_ANALYTICS_CLIENT_SECRETS}
      key_file_location: ''
      reports: ga4_reports.json
THen in my .env I have
Copy code
TAP_GOOGLE_ANALYTICS_CLIENT_SECRETS='{"type": "service_account","proje....
I found I needed to escape the new lines in the json private key, so
\n
becomes
\\n
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBg
That is for the old universal analytics, but I also use the newer ga4 style with exact same config.
a
@Andy Carter Thank you!!! This helped. I'm now getting another error though. Each time I run
docker run -v $(pwd):/meltano/adapty -w /meltano/adapty meltano/meltano config tap-bigquery test
I get
Copy code
[Errno 2] No such file or directory: '/meltano/adapty/.meltano/run/tap-bigquery/tap.0b018efa-2af0-47ee-a590-c66710f6ef89.config.json'
Where the "0b018efa-2af0-47ee-a590-c66710f6ef89" is always unique. I couldn't find any sort of context on this. Is there a chance this is happening because I didn't set values in --interactive mode but just by modifying the meltano.yml file?
e
I believe the mount is messing with the temp file location where Meltano dumps the plugin's config. It's probably worth add a
.dockerignore
with a line for
.meltano/
. If that works, it's probably worth documenting it.
a
@Edgar Ramírez (Arch.dev) Thank you for the suggestion. I switched to a python venv on a different machine, and still got the exact same error. I don't understand the origin of this error. The folder exists, but there is no file there, is it supposed to be there? Is it supposed to be created at runtime after I do "config plugin test" and then accessed by the same process?
a
Hi @Aleksei Perepelov you probably got this sorted ages ago, but dropping this here for anyone else looking. We’ve found the GA4 export to BigQuery approach to be the best. Tons faster, especially if your target supports batch messages. @Reuben (Matatika) wrote about it here https://medium.com/@rfrankel_8960/incredible-bigquery-extract-performance-3432b9cd83fe We really should make the PR back to the MeltanoLabs version as one of the things we added was support for credentials config using a json string https://github.com/Matatika/tap-bigquery
r