google-analytics - 如何使用Google Analytics(分析)API获得引荐流程?

标签 google-analytics google-api google-analytics-api

我有一个节点应用程序。在这里,我尝试使用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/

相关文章:

javascript - 如何在 Universal Analytics 中按页面类型生成报告

android - 如何SetModifiedDate()驱动SDK

r - 使用RGoogleAnalytics查询自定义维度

r - 使用 R/rga 从 GA 获取完整的未采样数据

c# - 使用 .NET 从 Google Analytics API 检索数据,多个指标?

javascript - 嵌入API自定义组件:Uncaught TypeError: Cannot read property 'ViewSelector2' of undefined

magento - Magento 1.5.1 CE中的Google Analytics(分析)电子商务跟踪错误

php - 找不到类“Spatie\Analytics\AnalyticsServiceProvider”

javascript - 我无法在 Google SpreadSheets 中插入值(使用 nodejs 和模块 googleapis)

javascript - 无响应的 Google jQuery 脚本