1 year ago

#362549

test-img

Creaticious

Google Analytics Data API - way to small values or missing data

Has anyone tried the new Google Analytics Data Api (still in beta) for a GA4-Property?

We did this, the way it is recommended in the docs here: https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries

Connection and authorization is working fine, but the values that are responded are way to small. For example it reported activeUsers for last 7 days as 50...but Analyitcs GUI has about 20.000...same as our old UA-Property that runs parallel. And the old reporting Api has the correct numbers...

We did it exactly like the reference example...

    client = BetaAnalyticsDataClient()

    request = RunReportRequest(
        property="properties/{0}".format(self.property),
        dimensions=[Dimension(name="defaultChannelGrouping")],
        metrics=[Metric(name="activeUsers")],
        date_ranges=[DateRange(start_date="7daysAgo", end_date="today")],
    )
    response = client.run_report(request)

    print("Report result:")
    for row in response.rows:
        print(row.dimension_values[0].value, row.metric_values[0].value)

This gives me:

Organic Search 34
Paid Search 19
Direct 6
Referral 3
Email 1

So "organic" for example should be around 20.000!

Funny thing is even the Query Explorer App (https://ga-dev-tools.web.app/query-explorer/) is showing these low numbers for the GA4-Property...

Any ideas what could be wrong? Thanks!

google-analytics

google-analytics-api

0 Answers

Your Answer

Accepted video resources