小编Joa*_*que的帖子

Google Analytics API V4:includeEmptyRows:'true',不工作

我正在将我的应用程序迁移到 V4,问题是您需要将 includeEmptyRows 设置为 TRUE,这就是我刚刚所做的。然而,空行根本没有填充。

function queryReports() {
    gapi.client.request({
        path: '/v4/reports:batchGet',
        root: 'https://analyticsreporting.googleapis.com/',
        method: 'POST',
        body: {
            reportRequests: [
                {
                    **includeEmptyRows: 'true',**
                    //**this above for empty rows

                    viewId: VIEW_ID,
                    dateRanges: [
                        {
                            startDate: startDate0,
                            endDate: endDate0
                        }
                    ],
                    //**below samplimg levels
                    samplingLevel: 'LARGE',
                    //request metrics here
                    metrics: [
                        {
                            expression: 'ga:sessions',
                        }
                        ,
                        {
                            expression:'ga:goalCompletionsAll',
                        },
                        {
                            expression:'ga:transactionRevenue',
                        },
                        {
                            expression:'ga:transactions',
                        },
                    ],
                    //request dimensions here
                    dimensions: [
                        {
                            name:'ga:channelGrouping',
                        },

                        {
                            name:'ga:yearMonth',
                        },
                    ],
                }
            ]
        }
    }).then(displayResults, console.error.bind(console)); …
Run Code Online (Sandbox Code Playgroud)

google-analytics-firebase

2
推荐指数
1
解决办法
1492
查看次数

标签 统计

google-analytics-firebase ×1