Package com.google.gdata.data.analytics

Examples of com.google.gdata.data.analytics.DataFeed


    String[][] expectedDimensionValues = new String[][] {{"a", "a", "b", "b", "b"},
        {"20100101", "20100103", "20100101", "20100102", "20100103"}};
    String[][] expectedMetricValues = new String[][] {{"1", "3", "4", "5", "6"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
        expectedMetricValues);
    resultManager.addRows(feed);

    table = results.getTable();
    assertEquals(2, table.size());
View Full Code Here


    String[][] expectedDimensionValues = new String[][] {{"a", "a", "a", "b"},
        {"20100101", "20100102", "20100103", "20100103"}};
    String[][] expectedMetricValues = new String[][] {{"1", "2", "3", "6"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
        expectedMetricValues);
    resultManager.addRows(feed);

    table = results.getTable();
    assertEquals(2, table.size());
View Full Code Here

    String[][] expectedDimensionValues = new String[][] {{"a", "a", "a", "b", "b"},
        {"20100101", "20100102", "20100103", "20100101", "20100103"}};
    String[][] expectedMetricValues = new String[][] {{"1", "2", "3", "4", "6"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
        expectedMetricValues);
    resultManager.addRows(feed);

    table = results.getTable();
    assertEquals(2, table.size());
View Full Code Here

    String[][] expectedDimensionValues = new String[][] {{"a", "b", "b", "b"},
        {"20100101", "20100101", "20100102", "20100103"}};
    String[][] expectedMetricValues = new String[][] {{"1", "4", "5", "6"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
         expectedMetricValues);
    resultManager.addRows(feed);

    table = results.getTable();
    assertEquals(2, table.size());
View Full Code Here

    String[][] expectedDimensionValues = new String[][] {{"a", "a", "a", "b"},
        {"20100101", "20100102", "20100103", "20100101"}};
    String[][] expectedMetricValues = new String[][] {{"1", "2", "3", "4"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
        expectedMetricValues);
    resultManager.addRows(feed);

    table = results.getTable();
    assertEquals(2, table.size());
View Full Code Here

    String[][] expectedDimensionValues = new String[][] {{"a", "a", "a", "b"},
        {"20100101", "20100102", "20100103", "20100101"}};
    String[][] expectedMetricValues = new String[][] {{"1", "2", "3", "4"}};

    DataFeed feed = asMock.getDataFeed(dimensionNames, expectedDimensionValues,
        expectedMetricValues, 5.5);
    resultManager.addRows(feed);

    assertTrue(results.getIsSampled());
  }
View Full Code Here

   * Grabs the response feed and prints it in CSV format
   * to standard output.
   * @param args Command Line Arguments.
   */
  public static void main(String[] args) {
      DataFeed feed = getDataFeed(getAnalyticsService("cvs_printing_demo"), getDataQuery());

      if(args.length > 0) {
        printFeedToFile(feed, args[0]);
      } else {
        // If no output stream is set, the default is to print to stdout.
View Full Code Here

   *     is authorized through Client Login.
   * @param query the query being sent to the Data Export API.
   * @returns the responds from the Data Export API.
   */
  private static DataFeed getDataFeed(AnalyticsService analyticsService, DataQuery query) {
    DataFeed dataFeed = null;
    try {
      // Make a request to the API.
      dataFeed = analyticsService.getFeed(query.getUrl(), DataFeed.class);
    } catch (IOException e) {
      System.err.println("Network error trying to retrieve feed: " + e.getMessage());
View Full Code Here

   * Returns a list of all the dimension values.
   * @param dataQuery A Data eport API query to send to the Data Export API.
   * @return A list of dimension values.
   */
  public List<String> getDimensionValues(DataQuery dataQuery) {
    DataFeed resultFeed = getFeed(dataQuery);

    List<String> output = new ArrayList<String>();
    for (DataEntry entry : resultFeed.getEntries()) {
      output.add(entry.getDimensions().get(0).getValue());
    }
    return output;
  }
View Full Code Here


  public static void main(String[] args) {
    // Entrance point of the application
    AnalyticsAdWordsAPISample example = new AnalyticsAdWordsAPISample();
    DataFeed analyticsData;
    AdGroupCriterionPage criterionPage;

    try {

      // Get Data Feed from Google Analytics.
View Full Code Here

TOP

Related Classes of com.google.gdata.data.analytics.DataFeed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.