Analytics Reporting API v4(Java)中的度量标准类

时间:2016-04-11 16:00:11

标签: java spring spring-boot google-analytics-api google-api-java-client

我正在尝试让这个示例正常工作https://developers.google.com/analytics/devguides/reporting/core/v4/samples#dimensions_and_metrics,但我似乎找不到合适的" Metric" Java库,我能找到的唯一的Metric类是" org.springframework.data.geo.Metric"并且它不是正确的,因为它与Analytics Reporting API v4中的指标无关。有什么帮助吗?

1 个答案:

答案 0 :(得分:1)

您需要下载并安装Analytics Reporting API V4 Java Client Library

有关详细信息,请参阅Google APIs java client library

摇篮:

将以下内容添加到build.gradle文件中:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.apis:google-api-services-analyticsreporting:v4-rev1-1.21.0'
}

MAVEN

将以下内容添加到pom.xml文件中:

<project>
  <dependencies>
    <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-analyticsreporting</artifactId>
      <version>v4-rev1-1.21.0</version>
    </dependency>
  </dependencies>
</project>