tsotsi
tsotsi

Reputation: 703

Java API for Google Analytics

I've found a great example here: https://developers.google.com/analytics/solutions/articles/data_over_time It uses google.gdata, not google.api. The credentials it is asking for are the following:

private static final String USERNAME = "username";
private static final String PASSWORD = "password";
private static final String TABLE_ID = "table_id";

Whereas in the google.api, the credentials needed are the following:

private static final String KEY_FILE_LOCATION = "yourfile.p12";
private static final String SERVICE_ACCOUNT_EMAIL = "[email protected]";

These two libraries (google.api and google.gdata) seem to be able to do similar things but in fact they are different. What is meant by username, password and table_id in the first scenario? Which is the currently recommended Java API for Google Analytics?

Upvotes: 3

Views: 6022

Answers (1)

Matt
Matt

Reputation: 5168

It is recommended that you use to Google Analytics Java client Libraries. The example you have pointed to uses the deprecated Client Login.

You should use the recently updated Hello Analytics API tutorial for a better example of using Java API for Google Analytics.

Upvotes: 1

Related Questions