Note: This API call only works with the new Opentracker Events Engine, please contact us for upgrading to this new technology.

Sessions by User

API Usage

This API produces a json array. Use it to retrieve sessions by a specified user. You can use this URL to perform GET or POST requests. Sessions can be retrieved based on a session_id, and/ or a machine_idx.

Parameters

One of the following parameters are required:

uid: Display data for these user id. User id is a unique identifier of each user.
date Display all visits from the specified date entered as yyyy-MM-dd. Default is the current date.
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 [support@opentracker.net].
password Your password.
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. A list of locales can be found here.
dataType The dataType parameter determines the format of the data returned. Values can be [json] | html | jsondatatable | jsonjqgrid
ignoreLocale Display columns without language translation. Boolean. [false]|true.
dateFormat The dateFormat parameter determines the format of dates returned. An example is dateFormat=yyyy-dd-MM. The syntax can be found here. nextToken: nextToken = timestampday.timestamphouroffset (only available in jsondatatable format)

Examples

To search for the visits with visit id 1319502921449.180515048:
HTTP GET/ POST: c_view_sessions_by_user.jsp?filterByMachineId=1319502921449.180515048&site=www.opentracker.net&login=demo@opentracker.net&password=demo123

Response

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

				{"rows": 1, "field": ["lastEvent", "duration", "status", "flag", "country", "visits_pageviews", "currentPage", "area", "area_code", "browser", "browser_version", "city", "company_org", "country_code", "country_name", "currentTitle", "currentVisitDuration", "dma_code", "entry_root_url", "entry_title", "eventUnixTimestamp", "event_id", "exit_root_url", "exit_title", "firstMeasurement", "first_session_unix_timestamp", "inet_aton", "ip_number", "isp", "isp_org", "lastVisitDuration", "latitude", "longitude", "machine_id", "machine_idx", "number_of_pages_viewed", "number_visits", "pages_viewed", "platform", "postal_code", "provider", "referrer", "referrersLogo", "region", "region_code", "resolution", "rnd", "search", "session_end_unix_timestamp", "session_id", "session_referrer", "session_referrer_hostname", "session_referrer_unix_timestamp", "session_start_unix_timestamp", "site", "timezone", "total_duration", "total_number_visits", "total_pages_viewed", "type", "use_id", "user_status", "visit_id", "zipCode"], "label": ["last event", "duration", "status", "flag", "country", "visits(pv)", "current page (exit page)", "area code (tel)", "area_code", "browser", "browser_version", "city", "company/ org", "country_code", "country_name", "currentTitle", "current visit duration", "dma_code", "entry_root_url", "entry title", "eventUnixTimestamp", "event_id", "exit_root_url", "exit title", "first measurement", "first_session_unix_timestamp", "inet_aton", "IP address", "isp", "isp/ org", "last visit duration", "latitude", "longitude", "machine_id", "machine_idx", "pages viewed during visits (avg.)", "number of visits", "pageviews", "operating systems", "postal_code", "provider", "referrer", "referrersLogo", "region", "region_code", "resolution", "rnd", "search term", "session_end_unix_timestamp", "session_id", "session_referrer", "session_referrer_hostname", "session_referrer_unix_timestamp", "session_start_unix_timestamp", "site", "timezone", "total duration", "total_number_visits", "total pages viewed", "type", "use_id", "status", "visit_id", "zip code"], "className": ["lastEvent", "duration", "status", "flag", "country", "visits_pageviews", "currentPage", "area", "area_code", "browser", "browser_version", "city", "company_org", "country_code", "country_name", "currentTitle", "currentVisitDuration", "dma_code", "entry_root_url", "entry_title", "eventUnixTimestamp", "event_id", "exit_root_url", "exit_title", "firstMeasurement", "first_session_unix_timestamp", "inet_aton", "ip_number", "isp", "isp_org", "lastVisitDuration", "latitude", "longitude", "machine_id", "machine_idx", "number_of_pages_viewed", "number_visits", "pages_viewed", "platform", "postal_code", "provider", "referrer", "referrersLogo", "region", "region_code", "resolution", "rnd", "search", "session_end_unix_timestamp", "session_id", "session_referrer", "session_referrer_hostname", "session_referrer_unix_timestamp", "session_start_unix_timestamp", "site", "timezone", "total_duration", "total_number_visits", "total_pages_viewed", "type", "use_id", "user_status", "visit_id", "zipCode"], "width": ["lastEvent", "duration", "status", "flag", "country", "visits_pageviews", "currentPage", "area", "area_code", "browser", "browser_version", "city", "company_org", "country_code", "country_name", "currentTitle", "currentVisitDuration", "dma_code", "entry_root_url", "entry_title", "eventUnixTimestamp", "event_id", "exit_root_url", "exit_title", "firstMeasurement", "first_session_unix_timestamp", "inet_aton", "ip_number", "isp", "isp_org", "lastVisitDuration", "latitude", "longitude", "machine_id", "machine_idx", "number_of_pages_viewed", "number_visits", "pages_viewed", "platform", "postal_code", "provider", "referrer", "referrersLogo", "region", "region_code", "resolution", "rnd", "search", "session_end_unix_timestamp", "session_id", "session_referrer", "session_referrer_hostname", "session_referrer_unix_timestamp", "session_start_unix_timestamp", "site", "timezone", "total_duration", "total_number_visits", "total_pages_viewed", "type", "use_id", "user_status", "visit_id", "zipCode"], "caption": "No caption", "pager": "apager", "nextToken": "1321313757710.180515048", "hidden": ["first_session_unix_timestamp", "timezone", "longitude", "latitude", "visit_id","machine_idx","total_pages_viewed", "countryName", "region", "city", "isp", "company_org", "isp_org", "provider", "referrersLogo", "referrer", "user_status", "number_visits", "pages_viewed", "currentTitle", "total_duration", "firstMeasurement", "platform", "browser", "resolution", "ip_number", "area","zipCode", "search", "lastVisitDuration", "currentVisitDuration", "endUnixTimestamp", "video", "download", "print"], "expandable": true, "popUpColumns":[["country", "countryName", "city", "region", "email", "video", "download", "print", "isp", "company_org", "isp_org", "provider", "area", "zipCode", "referrersLogo", "referrer","search", "user_status", "number_visits", "pages_viewed", "total_pages_viewed", "lastVisitDuration", "currentVisitDuration", "total_duration", "firstMeasurement", "platform", "browser", "resolution", "ip_number"],["currentPage", "currentTitle"]], "graph":[], "searchFields": [], "mergeUrl": [["currentPage", "currentTitle" ]], "merge":[], "profileColumns":["country", "countryName", "city", "region", "email", "video", "download", "print", "isp", "company_org", "isp_org", "provider", "visit_id", "area", "zipCode", "user_status", "number_visits", "pages_viewed", "total_pages_viewed", "lastVisitDuration", "currentVisitDuration", "total_duration", "firstMeasurement", "referrersLogo", "referrer","search", "platform", "browser", "resolution", "ip_number"], "expandUrl":"http://api.opentracker.net/api/visitors-online-email/cassandraPageViews.jsp?jsoncallback=?", "expand":[["filterByVisitId","", "", 1 ]], "expandDataIndex":[3, 4, 6], "equivalentColumns":[[6, "currentTitle"]], "rowsPerPageOptions": [ 20,40 ], "resultsList": [[ "Nov 17 12:46 AM", "20h 47m 3s", "puppet_online", "us", "United States", "12 (1171)", "http:\/\/www.opentracker.net\/loginpage", "718", "718", "Firefox 8.0", "8.0", "Brooklyn", "", "US", "United States", "Get in here. | Opentracker.net", "20h 47m 3s", "501", "http:\/\/www.opentracker.net\/loginpage", "Get in here. | Opentracker.net", "1321472798140", "1321472797944.180515048", "http:\/\/www.opentracker.net\/loginpage", "Get in here. | Opentracker.net", "Oct 25 06:35 AM", "1319502921449", "412285522", "24.146.250.82", "", "Optimum Online", "0s", "40.633194", "-73.9967", "10.245.194.182:1319502921449", "1319502921449.180515048", "1171", "12", "1171", "Windows XP", "11219", "optonline.net", "http:\/\/ot2.opentracker.net\/login\/logout.jsp", "opentracker.net", "New York", "NY", "1920 x 1080", "05177", "", "1321472797944", "1321397999803.180515048", "http:\/\/ot2.opentracker.net\/login\/logout.jsp", "opentracker", "1321397999803", "1321397999803", "www.opentracker.net", "America\/New_York", "", "12", "22075", "session", "1319502921449.180515048", "online", "1321397999803.180515048", "11219"] ] }
				

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