cancel
Showing results for 
Search instead for 
Did you mean: 

HANA XSJS example code for retrieving Google analytics data

gary_king2
Participant
0 Kudos

Has anyone come across any example XSJS (server side Javascript) code to extract google analytics data using their API?

There seems to be nothing out there and I'm having issues establishing authorisation and then extracting report data. I'm also having issues identify which auth method I should use for the server side access, be it OAuth, Service account or API Key.

gary_king2
Participant
0 Kudos

I have a request to retrieve google analytics data (only a handful of fields) containing details of the various sites being used by clients. The aim of this request was to call the google analytics API via XSJS and place the contents into a HANA table that the Ui5 app with retrieve.

There are a number of issues I have, some related to XSJS and some regarding the specific authorisation and method being used to connect to google analytics.

The first question is in regards to loading the GA API Library. How is this achieved in XSJS. I am aware that this may or may not be achieved using $.import, but my understanding is that can load values from .xsjslib files, but can it load a complete libary.

I believe I need to use an API Key to access GA, otherwise I'm going to have to use a user login, which I can not use. API keys are supposed to be available for App etc, and therefore I think this is te way forward.

I do have an example HTML with embedded javascript to test with, although that is not yet working, and I need to get to the bottom of that issue before I can tackle accessing via XSJS.

Accepted Solutions (0)

Answers (0)