我有一个节点应用程序。在这里,我尝试使用Google API从Google Analytics(分析)中获取引荐流。我已经提到尺寸,指标和其他必需参数。这是我的代码段,
// imported googleapis npm module
import google from "googleapis";
const analytics = google.analytics("v3");
// This is my payload to get the required analytics data
const analyticsData = {
auth: oauth2Creds,
accountId: "accountID",
webPropertyId: "webPropertyID",
profileId: "profileID",
ids: "ga:id",
"start-date": "90daysAgo",
"end-date": "today",
metrics: "ga:pageValue,ga:pageviews,ga:entranceRate,ga:exitRate",
dimensions: "ga:fullReferrer",
"start-index": "1"
};
// Function to get analytical data using the above payload
analytics.data.ga.get(analyticsData, (err, result) => {
// I will get the results here
console.log(result);
});
在这里,它仅返回与入口有关的数据。但是我需要获得每次推荐访问的流程。例如,如果用户从google进入主页并移至page2,page3并退出网站,那么我需要跟踪此流程。如何使用Google Analytics(分析)API完成此操作?
最佳答案
我可能不会直接回答您的问题,但我认为以下文档可能会为您提供帮助。
https://developers.google.com/analytics/devguides/reporting/mcf/v3/
关于google-analytics - 如何使用Google Analytics(分析)API获得引荐流程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45436006/