Google Analytics

Google Analytics GA4 API Dimensions & Metrics

mysop 2022. 7. 26. 09:28
반응형

https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema

 

API Dimensions & Metrics  |  Google Analytics Data API  |  Google Developers

API Dimensions & Metrics The dimensions and metrics supported in the Analytics Data API queries. Dimensions The following dimensions can be requested in reports for any property. Specify the "API Name" in a Dimension's name field for a column of the dimens

developers.google.com

 

페이지뷰와 도착주소를 기준으로 뽑을경우

 

$property_id = "애널리틱스 통계 번호";

// Make an API call.
$response = $client->runReport([
    'property' => 'properties/' . $property_id,
    'dateRanges' => [
        new DateRange([
            'start_date' => 'yesterday',
            'end_date' => 'today',
        ]),
    ],
    'dimensions' => [new Dimension(
        [
            'name' => 'fullPageUrl',
        ]
    ),
    ],
    'metrics' => [new Metric(
        [
            'name' => 'screenPageViews',
        ]
    )
    ]
]);

 

도착주소 : fullPageUrl

페이지뷰 : screenPageViews (screen_view + page_view events)

 

기존 애널리틱스랑 수치가 미묘하게 다르다.

 

구글애널리틱스 GA4

728x90
반응형