Hello! I’m very new to Meltano. I’m trying to extr...
# getting-started
l
Hello! I’m very new to Meltano. I’m trying to extract data from Google Analytics 4. I can see there’s a tap by singer-io, but I can’t understand how to add it to my Meltano project. Is it possible? Here’s the link to the tap: https://github.com/singer-io/tap-ga4
h
I am not familiar with the singer variant, but we have worked a little on another version. If you want to use the singer variant, I think you should be able to follow this general pattern and change the config - I can’t see exactly what config the singer tap needs. As of a few weeks ago, i had a working brach that was able to extract at least the demo data I had. If you add the following to meltano.yml, under the
loaders
block:
Copy code
- name: tap-google-analytics
    namespace: tap_google_analytics
    pip_url: git+<https://github.com/radbrt/tap-google-analytics-v4.git@work>
    capabilities:
    - state
    - catalog
    - discover
    select:
    - four_weekly_active_users.* # OK
    - locations.* # Schema inference failed? Fixed?
    - traffic_sources.* # Schema inference failed? Fixed?
    - transactions.* # OK
    - website_overview.* # schema inference failed
    - weekly_active_users.* # OK
    - daily_active_users.* # OK
    config:
      start_date: '2010-01-01T00:00:00Z'
    settings:
    # TODO: To configure using Meltano, declare settings and their types here:
    - name: start_date
    - name: property_id
    - name: key_file_location
    - name: oauth_credentials
    - name: reports
    - name: end_date
    - name: start_date
      value: '2010-01-01T00:00:00Z'
And set a few secrets in your .env file:
Copy code
TAP_GOOGLE_ANALYTICS_KEY_FILE_LOCATION='/Users/me/.gcp/key.json'
TAP_GOOGLE_ANALYTICS_PROPERTY_ID='123454321'
You can replace the pip_url with the repo for the singer variant, but as mentioned I don’t know much about what config is needed. When all that is done, just run
meltano install --clean
and it should all be installed. Honorable mention to the version of the tap I forked from: https://github.com/z3z1ma/tap-google-analytics-v4. We are several people here who are starting to use GA4, so there should be some movement here soon.
u
I just opened a PR to the hub for the ga4 versions https://github.com/meltano/hub/pull/1405. I wasnt aware of https://github.com/z3z1ma/tap-google-analytics-v4 or https://github.com/radbrt/tap-google-analytics-v4. @Henning Holgersen do you have a good sense of the different variants and what is the furthest in terms of development?
h
Excellent @pat_nadolny. I generally try to stay away from google-stuff and have only done the minimum possible, so I don’t have any deep knowledge, but I do have some. TL;DR: z1z1ma failed on a few streams when I tested, so I made a few fixes in my fork/branch. My fork/branch seems to work technically, but I can’t say much more. Maybe @Matt Menzenski or @aaron_phethean have thoughts. Rambling version: The connorflynn version seems to have a few issues, one of them was fixed in the z3z1ma version (something about a “value” property or something). I forked z1z1ma and fixed one issue where floats where interpreted as ints, and some issue with one of the streams (I removed a bunch of seemingly non-existing properties or measures or something). Especially on that stream property issue, someone should go through and check what is available to pull.
u
I'm going to leave a couple comments back over in https://meltano.slack.com/archives/C01PKLU5D1R/p1686150947898559 where we were initially discussing it
l
Thanks for all your comments. I tried using stitch yesterday for the first time and it seems to use the tap-ga4 under the hood, and it’s working nicely, at least with the pre-made reports.