Giter Site home page Giter Site logo

omniture_py's Introduction

Omniture_Py

A Python Library To Access Omniture's SiteCatalyst Reporting API

This library simplifies the process of accessing the Omniture SiteCatalyst Reporting API by wrapping the REST API calls in a Python library.

First, get access configured by reading through documentation at Omniture Developer Connection. Then, to test authentication/access:

import omniture_py  
ompy = OmniturePy('username:company','shared_secret')     
json_object =  ompy.run_omtr_immediate_request('Company.GetReportSuites', '')  
for suite in json_object["report_suites"]: 
    print "Report Suite ID: %s\nSite Title: %s\n" % (suite["rsid"], suite["site_title"])  

To get total number of page views yesterday, just run the following. It runs an Overtime report in SiteCatalyst, with pageViews as the metric, and returns the numeric total result.

print ompy.get_count_from_report('report_suite_name', 'pageViews') 

To get number of page views for "Homepage" and "Media Guide" combined, yesterday, run the following. It runs a Trended report in SiteCatalyst, using pageViews as the metric, and 'page' as the Element, and then selecting for pages titled either "Homepage" or "Media Guide":

print ompy.get_count_from_report('report_suite_name', 'pageViews', 'page', ["Homepage","Media Guide"])

The get_count_from_report function currently supports requesting one dimension (called an 'element') in addition to the date, which is always implied to be included. It also only currently supports requesting one metric at a time. If you wish to have lower-level access to the Omniture API than this, you can just use the run_omtr_queue_and_wait_request, and pass it the type of request and full request body. This will return a Python object.

obj = ompy.run_omtr_queue_and_wait_request('Report.QueueTrended', {"reportDescription" : reportDescription})

Full documentation on each of the parameters available to these methods can be found within the code.

omniture_py's People

Contributors

robgoretsky avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.