Visits

All visits (sessions) to a site

API Usage

This API produces a json array. Use it to retrieve visits. You can use this URL to perform GET or POST requests. Visits can also be retrieved based on a visit_id, and/ or a machine_idx.

Parameters

One of the following parameters are required:

filterByMachineId Display data for these machine_ids. Machine id is a unique identifier of each visitor. Default is all machine_idx's.
filterByVisitId Display data for these visit_ids. Visit id is a unique identifier of each visit. Default is all visit_ids.
showColumns Display only the columns specified in this parameter. The columns are input as a comma separated list. Only the raw technical column names are recognized. Click here to see the list. By default, all columns are shown.
hideColumns Does not display the columns specified in this parameter. The columns are input as a comma separated list. Only the raw technical column names are recognized. Click here to see the list. If both showColumns and hideColumns are specified, showColumns will override hideColumns. By default, all columns are shown.
date Display all visits from the specified date entered as yyyy-MM-dd. Default is the current date.
period The time-range considered for displaying the visits with respect to the date. For example: 3d for 3 days offset. Default is [1d].
offset The starting point from where records will display. Default is [0] (most recent chronological event).
limit The maximum number of records to be displayed in the output. Default is [40]. Maximum is 10,000.
login Your opentracker login email. Default is [demo@opentracker.net].
password Your password.
ticketId A ticketId can be used to provide credentials with an expiring token. A ticketId can be used instead of a login/ password combination. Further information can be found here. Default is [demo123].
site The site for which to display data. Default is [www.opentracker.net].
locale The locale parameter is an identifier for a particular combination of language and region (e.g. en_US) and determines the format of the data returned. Default is [en_US]. A list of locales can be found here.
ignoreLocale Display columns without language translation. Boolean. [false]|true.
timeZone The timezone to view the visits in. Default is the site's defined timezone.
dataType The dataType parameter determines the format of the data returned. Values can be [json] | html | jsondatatable | jsonjqgrid
dateFormat The dateFormat parameter determines the format of dates returned. An example is dateFormat=yyyy-dd-MM. The syntax can be found here.

Examples

To retrieve the 10 most recent visits to the website www.opentracker.net for the user "demo@opentracker.net" with password "demo123":
HTTP GET/ POST: view_visits.jsp?login=demo@opentracker.net&password=demo123&site=www.opentracker.net&offset=0&limit=10

To search for the visits with visit ids 6698199 and 6698320 with a machine id 1234567:
HTTP GET/ POST:view_visits.jsp?filterByVisitId=6698199,6698320&filterByMachineId=1234567

To only display the columns visit_id, currentTitle, currentPage(url) from the visit data :
HTTP GET/ POST:view_visits.jsp?dataType=html&showColumns=visit_id,currentTitle,currentPage

To search for all visits made by the user with a machine id "1234567":
HTTP GET/ POST: view_visits.jsp?filterByMachineId=1234567

Response

This last example returns a json array with 'n' entries formatted as:

                  



 




{ "resultsList": [
{
"error":"No results",
"error_description":"No results for this period 1d"}
]
}



               

Errors

If errors are encountered, the first encountered error will be returned of form "Error: exception: message

Error: java.lang.RuntimeException: Login/ site combination is not valid
------------- usecase0: i'm looking for the last 40 (limit) visits -> one index (session table) -> . -> last 40 sessions * bucket issue needs to be addressed, buckets are indexing the session cf (table). ------------- ------------- usecase1: i'm looking for a machine id's visits always for a site 40 (limit) -> one index -> .123142.* @-> x sessions (no bucket issue, immediately get from sessions cf (table)). usecase2: i'm looking for a machine id's visits one year ago -> one index -> .1234341.2009* @-> sessions ------------- ------------- usecase3: i'm looking for a visit_id for a site -> one index -> .123142 -> session column family (table). ------------- ------------- usecase4: i'm looking for a machine_id with this visit_id -> not available query ------------- ------------- or deprecate offset, and just use next tokens. so implement a next token. offset: we just iterate through. eg offset = 300, limit = 100 -> we need to iterate through first 301 keys, and use 301 - 400, preferably no memory problems = memory / key size = iteration size. ------------- Parameters:

*filterByMachineId: Display data for these machine_ids. Machine id is a unique identifier of each visitor. Default is all machine_idx's.
*filterByVisitId: Display data for these visit_ids. Visit id is a unique identifier of each visit. Default is all visit_ids.
from Find all visits from the specified unix timestamp. Default is all unix timestamps.
to Find all visits up to the specified unix timestamp. Default is all unix timestamps.
*offset The starting point from where records will display. Default is [0] (most recent chronological event).
*limit The maximum number of records to be displayed in the output. Default is [40]. Maximum is 10,000.

We would love to hear your feedback. Please use the facebook comment box below