Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 308
tsotsi Avatar asked Mar 14 '26 20:03

tsotsi


1 Answers

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.

like image 92
Matt Avatar answered Mar 16 '26 11:03

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!