Question

I currently use Adobe Omniture SiteCatalyst, Google Analytics, and New Relic. All three offer visit and page view metrics. SiteCatalyst has no API that I'm aware of, and their data is often hours behind. Google Analytics and New Relic both offer realtime APIs, but I find that the metrics offered differ wildly across vendors.

What's the best method (API) for measuring realtime visits (page views, unique visitors, etc.)?

Ultimately, I intend to use this data to present realtime conversion rates to my business customers.

Was it helpful?

Solution

Adobe SiteCatalyst does have a realtime api that you can use. It functions in a similar way that reports in SiteCatalyst work.

Here is python example request:

import requests
import sha
import binascii
import time

your_report_suite="ReportSuiteId" #The name of the report suite
what_you_are_looking = "someValue"  #value of a the prop that you want to find in the realtime stream

def getRealTimeUsers():
    if mobile:
        url = 'https://api.omniture.com/admin/1.3/rest/?method='
        headers = {'X-WSSE': self.generateHeader()}
        method = 'Report.GetRealTimeReport'
        report_url = url + method
        payload = {
            "reportDescription": {
                "reportSuiteID": your_report_suite,
                "metrics": [
                    {
                        "id": "instances"
                    }
                ],
                "elements": [
                    {
                        "id": "prop4",
                        "search": {
                            "type": "string",
                            "keywords": what_you_are_looking
                        }
                    }

                ]
            }
        }
        response = requests.post(url=report_url, headers=headers, data=json.dumps(payload))
        data = response.json().get('report').get('data')

   def generateHeader():
        # Generates the SC headers for the request
        nonce = str(time.time())
        base64nonce = binascii.b2a_base64(binascii.a2b_qp(nonce))
        created_date = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.localtime())
        sha_object = sha.new(nonce + created_date + self.sc_key)
        password_64 = binascii.b2a_base64(sha_object.digest())

        return 'UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"' % (
        self.sc_user, password_64.strip(), base64nonce.strip(), created_date)

Note: Realtime reporting requires that the realtime feature is turned on in your report suite. Also the realtime reports are limited in their dimensionality. There is not a whole lot of documentation on the particular requests required but there is this: https://marketing.adobe.com/developer/documentation/sitecatalyst-reporting/c-real-time

Also I highly recommend experimentation by using the api explorer: https://marketing.adobe.com/developer/api-explorer#Report.GetRealTimeReport

OTHER TIPS

What kind of delay is acceptable? What about accuracy and detail? Script-based systems like Google Analytics require Javascript to be enabled and provide plenty of details about the visitor's demographic and technical information, but raw webserver logfiles give you details about every single request (which is better for technical insight, as you get details on requested images, hotlinking, referrers and other files).

Personally, I'd just use Google Analytics because I'm familar with it, and also because their CDN servers mean that my site won't load slowly; but otherwise I just run typical logfile analysis software on my raw webserver logs, however depending on your software this file analysis can take time to generate a report.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top