How to get Google Analytics data using OAuth?

后端 未结 4 939
Happy的楠姐
Happy的楠姐 2020-12-05 06:09

Hy guys, we are developing a system which will provide users with access to Google Analytics. I\'m trying to implement it in the way so user don\'t need to enter their Googl

4条回答
  •  一向
    一向 (楼主)
    2020-12-05 06:26

    I don't think you need to mess with OAuth.

    The google analytics api lets you pass credentials. Just start from this data feed example.

    http://code.google.com/p/google-gdata/source/browse/trunk/clients/cs/samples/Analytics_DataFeed_Sample/dataFeed.cs

    // Configure GA API and do client login Authorization.
    AnalyticsService asv = new AnalyticsService("gaExportAPI_acctSample_v2.0");
    asv.setUserCredentials(clientUser, clientPass);
    

    Download the client library here

    http://code.google.com/apis/analytics/docs/gdata/gdataLibraries.html

    To get a feel for data queries, play with this and then copy the values into the example above

    http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html
    

提交回复
热议问题