SimpleAnalytics Reader

Desktop app for displaying data collected with the SimpleAnalytics package

The SimpleAnalytics package allows you to collect data user interaction analytic data in iOS and macOS applications. This SimpleAnalytics Reader app project allows you to more easily make sense of that collected data by displaying it on your Mac. It can run right out of the box with one minor configuration step.

SimpleAnalytics Reader screenshots.

Setup

SimpleAnalytics Reader works by sending database queries to a backend app, which forwards them to the database that’s collecting your analytics data. Therefore you need to make a web app available, and add a text file with the URL for it in the SimpleAnalytics Reader project folder.

Web app

The query.php file at the top level of the project’s repository folder is the best starting point for providing a web app. If you have PHP and MySQL available on your web service (and you’re using MySQL for collecting your data), you can configure the file for database access and upload it to your service.

If that’s not the case, or you prefer to build your web app with another language, your web app should be able to handle POST requests with two parameters encoded in JSON in the request body:

Label Contents
query A String with semi-colon delimited SQL queries (usually two at the most)
queryMode A String with a value of either “array” or “dictionary”

Your web app should pass the request on to your database, and return the search results as a JSON object whose format depends on the queryMode parameter passed in:

Query Mode Format
Array [[String]] Array of arrays containing the retrieved values as strings. The outer array may contain any number of inner arrays. Inner arrays always contain a single value. In PHP this is a numeric Array.
Dictionary [[String : String]] (array of dictionaries) structure. The inner dictionary’s key is the database column name, and the value is the row’s value for that column. In PHP this is an associative array.

Example of an Array return value:

▿ 2 elements
  ▿ 0 : 1 element
    - 0 : "iOS (iPad)"
  ▿ 1 : 1 element
    - 0 : "iOS (iPhone)"

Example of a Dictionary return value:

<div class="snippet-clipboard-content position-relative" data-snippet-clipboard-copy-content="▿ 4 elements
▿ 0 : 2 elements
▿ 0 : 2 elements
– key : " count" ▿ value :
– some : “9”
▿ 1 : 2 elements
– key : “description”
▿ value :
– some : “Added observation from phone”
▿ 1 : 2 elements
▿ 0 : 2 elements
– key : “description”
▿ value :
– some : “Added observation from watch”
▿ 1 : 2 elements
– key : “count”
▿ value :
– some : “17”
▿ 2 : 2 elements
▿ 0 : 2 elements
– key : “description”
▿ value :
– some : “Displayed session summary”
▿ 1 : 2 elements
– key : “count”
▿ value :
– some : “9”
▿ 3 : 2 elements
▿ 0 : 2 elements
– key : “description”
▿ value :
– some : “Edited Session title”
▿ 1 : 2 elements
– key : “count”
▿ value :
– some : “2”
“>

▿ 4 elements
  ▿ 0 : 2 elements
    ▿ 0 : 2 elements
      - key : "count"
      ▿ value : 
        - some : "9"
    ▿ 1 : 2 elements
      - key : "description"
      ▿ value : 
        - some : "Added observation from phone"
  ▿ 1 : 2 elements
    ▿ 0 : 2 elements
      - key : "description"
      ▿ value : 
        - some : "Added observation from watch"
    ▿ 1 : 2 elements
      - key : "count"
      ▿ value : 
        - some : "17"
  ▿ 2 : 2 elements
    ▿ 0 : 2 elements
      - key : "description"
      ▿ value : 
        - some : "Displayed session summary"
    ▿ 1 : 2 elements
      - key : "count"
      ▿ value : 
        - some : "9"
  ▿ 3 : 2 elements
    ▿ 0 : 2 elements
      - key : "description"
      ▿ value : 
        - some : "Edited Session title"
    ▿ 1 : 2 elements
      - key : "count"
      ▿ value : 
        - some : "2"