Data Extraction

4 Posts authored by: Rob Derstadt

Smart Measures

Posted by Rob Derstadt Mar 26, 2009

       Reports that contain "smart measures" will show more columns available in the report definition than are really valid for an actual request. This is an important distinction. Reports that use smart measures (which are typically only those with visitor counts, buyers or recent campaigns) will show that there are 5 visitor measures available (one each for day, week, month, etc). However, when they request report data they will only get ONE of those back, based on the period they provide. For example, if they specify period=2009m01, they will only get the smart measure for monthly visitor count.This makes sense since a monthly count would not be valid for a daily period. 

If you're in the WebTrends UI you can find a report GUID (for use in building a rest query) by looking at the javascript tag information that displays when you hover over a report in the left-nav. In this case, I am hovering over the link to the report "Same Visit Campaign Names". The browser will display the javascript that is executed when this link is clicked in the lower left-hand corner of the window (circled below). The tag displayed contains "dynamictables<table GUID><Chapter>" You can view the properties of this link to pull this text out and then copy only the GUID portion, which is simply the text between "dynamictables" and "Chapter". In this case it is "aK1I9lMxvL5". This comes in handy if you're viewing a report and want to quickly pull up the data using the web services.

 

dx.bmp

 

 

 

dx2.bmp

Here is a quick example of using Ruby to call WebTrends Web Services:

 

  def query(account, username, password, query)
   
     hostname = "ws.webtrends.com"
    
     https =  Net::HTTP.new(hostname, Net::HTTP.https_default_port)
     https.use_ssl = true
     https.ca_file = "/usr/share/curl/curl-ca-bundle.crt"


     resp = https.start { |http|
      
       request = Net::HTTP::Get.new("/beta/ReportService.svc/" + query)
     
       request.basic_auth account + '\\' + username, password
           
        res = http.request(request)

 

        case res

 

        when Net::HTTPSuccess, Net::HTTPRedirection
         
          return  res.body
       
        else
       
          res.error!
       
        end
       
      }
      
  end

 

The method call would look something like this:

 

@foo = query("My Account", "My User Name", "My Password", "profile/?format=json")

We will keep this blog post updated with the latest known issues for our DX API. Please check here first, before submitting a bug to Webtrends if you are having problem.

 

 

The beta API was last updated on May 21st, 2009. Enhancements include:

 

  • Calculated measures will no longer display in report definitions. Currently, these are only available through the Analytics user interface.
  • The report "category" has been added to the report listing. This will make it easier to obtain a list of reports matching a specific report "category". If a report has no defined category the attribute will not be displayed.
  • In some cases a report was enabled for trending, but the report meta-data did not accurately reflect this. There was a bug in the logic that determined if trending was enabled. This has been resolved.
  • The ability to filter based of a discrete set of measure identifiers was not working. This was a bug and has been resolved.
  • The profile summary report, when returned in Excel format, contained invalid XML what was preventing it from rendering properly. This has been resolved.

 

Beta API Known Issues

 

  • Totals will not be displayed in report data. Client applications can easily aggregate their own data or compute new measures (i.e. a "calculated measure").
  • Dimension attributes for multi-dimensional reports are not currently supported.These will be added in a future release.
  • Some dimension "names" do not match those shown in the UI. This is a translation problem and will also be addressed in a future release.
  • Smart Measures, if available, will show up in report definitions. However, the actual measures displayed is dependent upon the time period specified when performaing a query. If you are requesting specific measures you need to be sure to include the correct smart measure for the time period desired. For example, if you are specifying a daily time period (e.g. 2008m02d24) then you should only specify the smart measure that applies to a daily time period. If not, an error will result.
  • Trending performance is "slow". In some cases it may be possible to improve trending by performing individual requests and calculating the trend on the client.

    Filter Blog

    By date:
    By tag: