Google API returns 不正确的值

Google API returns incorrect values

我想从 Analytics API 中按页面完成目标。日期相同,采样关闭。

API:

{ kind: 'analytics#gaData',
  id: 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga:90090243&dimensions=ga:hostname,+ga:pagePath&metrics=ga:users,ga:goalCompletionsAll,ga:goalValueAll&start-date=2015-01-05&end-date=2015-01-05',
  query: 
   { 'start-date': '2015-01-05',
     'end-date': '2015-01-05',
     ids: 'ga:90090243',
     dimensions: 'ga:hostname, ga:pagePath',
     metrics: [ 'ga:users', 'ga:goalCompletionsAll', 'ga:goalValueAll' ],
     'start-index': 1,
     'max-results': 1000,
     samplingLevel: 'HIGHER_PRECISION' },
  itemsPerPage: 1000,
  totalResults: 10,
  selfLink: 'https://www.googleapis.com/analytics/v3/data/ga?ids=ga:12345678&dimensions=ga:hostname,+ga:pagePath&metrics=ga:users,ga:goalCompletionsAll,ga:goalValueAll&start-date=2015-01-05&end-date=2015-01-05',
  profileInfo: 
   { profileId: '12345678',
     accountId: '12345678',
     webPropertyId: 'UA-12345678-1',
     internalWebPropertyId: '12345678',
     profileName: 'All Web Site Data',
     tableId: 'ga:90090243' },
  containsSampledData: false,
  columnHeaders: 
   [ { name: 'ga:hostname',
       columnType: 'DIMENSION',
       dataType: 'STRING' },
     { name: 'ga:pagePath',
       columnType: 'DIMENSION',
       dataType: 'STRING' },
     { name: 'ga:users', columnType: 'METRIC', dataType: 'INTEGER' },
     { name: 'ga:goalCompletionsAll',
       columnType: 'METRIC',
       dataType: 'INTEGER' },
     { name: 'ga:goalValueAll',
       columnType: 'METRIC',
       dataType: 'CURRENCY' } ],
  totalsForAllResults: 
   { 'ga:users': '155',
     'ga:goalCompletionsAll': '0',
     'ga:goalValueAll': '0.0' },
  rows: 
   [ [ 'mydomain.com', '/', '1', '0', '0.0' ],
     [ 'mydomain.com',
       '/brand-business-bundle',
       '1',
       '0',
       '0.0' ],
     [ 'mydomain.com',
       '/brand-business-internet',
       '1',
       '0',
       '0.0' ],
     [ 'mydomain.com', '/business-bundle', '1', '0', '0.0' ],
     [ 'mydomain.com',
       '/business-fiber-internet',
       '22',
       '0',
       '0.0' ],
     [ 'mydomain.com', '/business-internet', '37', '0', '0.0' ],
     [ 'mydomain.com', '/business-phone', '84', '0', '0.0' ],
     [ 'mydomain.com', '/privacy-policy', '1', '0', '0.0' ],
     [ 'mydomain.com',
       '/small-business-internet',
       '6',
       '0',
       '0.0' ],
     [ 'co.lumb.co', '/', '1', '0', '0.0' ] ] }

这是我在分析仪表板中看到的内容:

我尝试过的事情:

为什么我从 API 返回这么低的值,而仪表板显示的不是这样?

最莫名其妙的是用了2个月左右突然坏了。我怀疑 Analytics API.

中引入了错误

解决方法是使用 ga:goalCompletionLocation 而不是 ga:pagePath。我将其称为解决方法而不是解决方案,因为就指标而言,您无法将 ga:goalCompletionLocation 与其他许多东西结合使用。