为什么Google Analytics(分析)查询响应的总用户数量随维度而变化? [英] Why Google analytics query response total user count varying with dimensions?

查看:136
本文介绍了为什么Google Analytics(分析)查询响应的总用户数量随维度而变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用google-api npm从Google Analytics(分析)中提取数据.

Pulling data from google analytics using google-api npm.

当我尝试使用查询浏览器查询特定日期2020-05-01时,总用户为204.

When I tried query for a particular date 2020-05-01 using Query Explorer , total user is 204.

添加介质ga:medium时,总数为205.

When adding medium ga:medium the total count is 205.

我要查询

来源,媒介,pagePath,channelGrouping,deviceCategory和日期作为维度.

source,medium,pagePath,channelGrouping,deviceCategory,and date as dimensions.

因此,总用户数接近300. 我正在从该查询的响应中保存数据.

So the total users count is near to 300. I'm saving the data from response of this query.

我需要显示一天的总用户人数.我该如何处理?

I need to to show the total user for a day. How can I handle this?

查询在下面

const res = await analyticsreporting.reports.batchGet({
        requestBody: {
            reportRequests: [
                {
                    viewId: defaultProfileId,
                    dateRanges: dateRanges,
                    includeEmptyRows: false,
                    'pageSize': 10000,
                    metrics: [
                        {
                            expression: 'ga:users',
                        },
                        {
                            expression: 'ga:sessions',
                        },
                        {
                            expression: 'ga:bounces',
                        },
                        {
                            expression: 'ga:avgSessionDuration',
                        },
                        {
                            expression: 'ga:pageviews',
                        },
                        {
                            expression: 'ga:newUsers',
                        },
                        {
                            expression: 'ga:sessionDuration',
                        },
                        {
                            expression: 'ga:pageviewsPerSession',
                        },
                        {
                            expression: 'ga:bounceRate',
                        },
                        {
                            expression: 'ga:goalCompletionsAll',
                        },
                    ],
                    dimensions: [
                        {
                            name: 'ga:source'
                        },
                        {
                            name: 'ga:medium'
                        },
                        {
                            name: 'ga:pagePath'
                        },
                        {
                            name: 'ga:channelGrouping'
                        },
                        {
                            name: 'ga:deviceCategory'
                        },
                        {
                            name: 'ga:date'
                        }
                    ]
                },
            ],
        },
    });

推荐答案

Google Analytics(分析)是一个多维数据库.

Google analytics is a multidimensional database.

从多个关系数据库中创建一个多维数据库.关系数据库允许用户以查询形式访问数据,而多维数据库则允许用户提出与业务或市场趋势有关的分析性问题.

A multidimensional database is created from multiple relational databases. While relational databases allow users to access data in the form of queries, the multidimensional databases allow users to ask analytical questions related to business or market trends.

多维数据库使用MOLAP(多维在线分析处理)来访问其数据.它们使用户可以通过相当快地生成和分析数据来快速获得他们的请求的答案.

The multidimensional databases uses MOLAP (multidimensional online analytical processing) to access its data. They allow the users to quickly get answers to their requests by generating and analyzing the data rather quickly.

多维数据库中的数据以数据多维数据集格式存储.这意味着可以从多个维度和角度查看和理解数据.

The data in multidimensional databases is stored in a data cube format. This means that data can be seen and understood from many dimensions and perspectives.

此方法的工作方式是根据您要求的尺寸进行分析.并给您答复.您不能分析两个不相关的事物并期望得到相同的结果.获得结果的唯一方法是尺寸完全相同.

The way this works is that it analyzes on the dimensions that you are requesting. and gives you a response. You cant analyze on two unrelated things and expect the same results. The only way you would get the result back would be if they have the exact same dimensions.

您可以比较苹果并获得苹果的总数,但如果其中一个苹果没有标签,该怎么办?如果它的标签是史密斯奶奶史密斯,那将不包括在内,因为它没有标签苹果.

You can compare apples and get a total count of apples but what if there one of the apples is not labels apple what if its labels granny smith well thats not going to be included because it doesn't have the label apple.

如果您的数据没有一个称为记录的媒介的维度,并且数据为空,那么数据丢失时,Google Analytics中就会出现问题,因为该数据不存在,因此不会包含在您的请求中.

Issues come in Google analytics when data is missing if your data doesn't have a dimension called medium for a record and its null then that is not going to be included in your request because the data doesn't exist.

同样,这不是一个关系数据库,您不能将其视为此类数据库.

Again this isnt a relational database you cant treat it as such.

这篇关于为什么Google Analytics(分析)查询响应的总用户数量随维度而变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆