Getting page views from google analytics

Hey Guys,

I am using google analytics to track page views. I am trying to fetch this data to bubble using GA4 APIs but the data I see on the dashboard and the data I am receiving from APIs are very different. I am using ‘screenpageViews’ metric to get the data.

{
    "dateRanges": [
        {
            "startDate": "1500daysAgo",
            "endDate": "today"
        }
    ],
    "metrics": [
        {
            "name": "screenPageViews"
        }
    ],
    "dimensionFilter": {
        "filter": {
            "stringFilter": {
                "matchType": "BEGINS_WITH",
                "value": "*pageURL*"
            },
            "fieldName": "pageLocation"
        }
    },
    "dimensions": [
        {
            "name": "fullPageUrl"
        },
        {
            "name": "pagePath"
        }
    ]
}

I am using the exact filters on the dashboard as well, Does anyone have any idea why there is difference?

Thanks,
RP

This topic was automatically closed after 70 days. New replies are no longer allowed.