1

In my code this line

   DataFeed dataFeed = analyticsService.getFeed(query.getUrl(),DataFeed.class);

throwing java.lang.reflect.UndeclaredThrowableException,

I tried with both this query URLs

1. DataQuery query = new DataQuery(new URL("https://www.google.com/analytics/feeds/data"));
2. DataQuery query = new DataQuery(new URL("https://www.googleapis.com/analytics/v2.4/data")); 

sometimes for some id's it is giving result but most of the time it is throwing the exception any suggestion please, it is killing my time

These are my query parameters

 query.setStartDate(startDate);
 query.setEndDate(endDate);
 query.setIds(tableID);
 query.setDimensions("ga:pagePath");
 query.setMetrics("ga:pageviews");
 query.setSort("-ga:pageviews");    

1 Answer 1

1

I found the answer by myself by including one more query parameter

 query.setStringCustomParameter("key","my-key");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.