adobe analytics api python

Adobe Analytics data – Reports API v2.0 & Python

Adobe Analytics v2.0 API offers quite a lot of functionality. Adobe has made huge steps over the last few years in documenting and rebuilding its APIs. The majority of the information can be found at https://github.com/AdobeDocs/analytics-2.0-apis. One of the most useful one is the Reports API for downloading analytics reports data. This can be utilised in automated Python (or other programming languages) data pipelines and/or ad-hoc analysis in setups outside of Analysis Workspace.

However, the API exposed currently is not – for lack of better word – very well structured and programming-friendly. The major drawback is that it was build with the intent of serving Analysis Workspace. This means that it requires a specific JSON data structure that defines the report to be requested (sample).

Depending on the number of dimensions added on the report, this can get very complicated very quickly. In order to get around that, I have created Python package that allows to better manage multiple dimensions without the added burden of worrying about multiple breakdowns.

Python package overview

The package offers some basic high level wrappers and abstracts the complexity of “how to make data requests for multiple breakdowns”.

It relies on using a service account with developer access. To install the latest version using pip (either from PyPi or GitHub)

  • PyPi: pip install analytics-mayhem-adobe
  • Github: pip install git+https://github.com/konosp/adobe-analytics-reports-api-v2.0

Sample of execution

Results

Data is returned as a Pandas data frame in the following format:

If you are interested in improving the project, request features, raise bugs or just ask questions, check https://github.com/konosp/adobe-analytics-reports-api-v2.0/issues

Leave a Reply

Your email address will not be published. Required fields are marked *