get_report 函数中的无效值错误

invalid value error in get_report function

def get_report(analytics):
  return analytics.reports().batchGet(
      body={
              'reportRequests': 
              [
                  {
                    'viewId': VIEW_ID,
                    'dateRanges': [{'startDate': '7daysAgo', 'endDate': 'today'}],
                    'metrics': [{'expression':i} for i in METRICS],
                    'dimensions': [{'name':j} for j in DIMENSIONS]
                  }
              ]
           }
  ).execute()

File "/home/mail_name/gaToPandas/lib/python3.5/site-packages/googleapiclient/http.py", line 851, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json returned "Invalid value 'project-id@appspot.gserviceaccount.com' for viewId parameter.">

我该如何解决这个问题? 本站第3步有错误https://www.digishuffle.com/blogs/google-analytics-reporting-python/

"Invalid value 'project-id@appspot.gserviceaccount.com' for viewId parameter."

视图 ID 应该是来自 Google Analytics 的视图 ID,您希望为其请求数据而不是服务帐户名称。