Visits by Geo location

Display location of all visits. Search and filter visits based on geo-location. This specific api call is turned off by default, please contact support@opentracker.net to turn this api call on.

API Usage

This API produces a json array. Use this URL to perform GET or POST requests.

Parameters

One or more of the following parameters are required:

filterByLocation: A parameter used to search through all location data. By default all locations are retrieved.
filterByMachineId Display data for these machine ids. Machine id is a unique identifier of each visitor. Default is all machine ids.
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 the records are to be displayed. Default is [0] (most recent chronological event).
limit Maximum number of records to be displayed in the output. The default is [40]. Maximum is 10,000.
login Your opentracker email login. Default is [support@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.
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. Syntax can be found here.

Examples

To search for all visits to www.opentracker.net coming from Florida, United States use the location abbreviation "us,fl". There are many options, a country-code (UK), -name (United Kingdom), or city (London) will also work:
HTTP GET/ POST: view_location.jsp?login=demo@opentracker.net&password=demo123&site=www.opentracker.net&filterByLocation=us,fl&offset=10&limit=5

Response

A json array is returned with 'n' entries starting from the specified offset formatted as:

				






{ "resultsList": [
{
"visit_id":"1123606",
"machine_idx":"867567",
"last event":"Jul 27 23:07 PM +0500",
"duration":"19m 51s",
"country":"\/images\/general\/login\/flags\/US.gif",
"status":"\/images\/general\/login\/puppets\/puppet_offline.png",
"visits(pv)":"2 (21)",
"current page (exit page)":"https:\/\/www.opentracker.net\/products\/web-analytics",
"currentTitle":"Web Analytics | Opentracker Analytics",
"countryName":"United States",
"city":"Lynn Haven",
"region":"Florida",
"isp":"",
"org_company":"Unknown",
"isp/ org":"Wideopenwest",
"provider":"knology.net",
"area code (tel)":"850",
"ZIP/ postal code":"32444",
"referrers Logo":"",
"referrer":"Unknown",
"search term":"Unknown",
"user status":"offline",
"number of visits":"2",
"pageviews":"21",
"total pages viewed":"44",
"last visit duration":"19m 51s",
"current visit duration":"00s",
"total duration":"20m 36s",
"first measurement":"Jul 27 22:34 PM +0500",
"platform/ OS":"Android",
"browser":"Chrome 59.0.3071.125",
"resolution":"1024 x 600",
"IP address":"216.186.130.150"}
,
{
"visit_id":"1123597",
"machine_idx":"867547",
"last event":"Jul 27 22:46 PM +0500",
"duration":"04m 50s",
"country":"\/images\/general\/login\/flags\/US.gif",
"status":"\/images\/general\/login\/puppets\/puppet_offline.png",
"visits(pv)":"3 (6)",
"current page (exit page)":"https:\/\/www.opentracker.net\/docs\/resources\/how-does-user-tracking-work",
"currentTitle":"How does user-tracking work? | Opentracker Analytics",
"countryName":"United States",
"city":"Lynn Haven",
"region":"Florida",
"isp":"",
"org_company":"Unknown",
"isp/ org":"Wideopenwest",
"provider":"knology.net",
"area code (tel)":"850",
"ZIP/ postal code":"32444",
"referrers Logo":"",
"referrer":"Unknown",
"search term":"Unknown",
"user status":"offline",
"number of visits":"3",
"pageviews":"6",
"total pages viewed":"19",
"last visit duration":"04m 50s",
"current visit duration":"00s",
"total duration":"13m 29s",
"first measurement":"Jul 27 22:02 PM +0500",
"platform/ OS":"Android",
"browser":"Chrome 59.0.3071.125",
"resolution":"534 x 320",
"IP address":"216.186.130.150"}
,
{
"visit_id":"1123589",
"machine_idx":"867567",
"last event":"Jul 27 22:35 PM +0500",
"duration":"45s",
"country":"\/images\/general\/login\/flags\/US.gif",
"status":"\/images\/general\/login\/puppets\/puppet_offline.png",
"visits(pv)":"2 (2)",
"current page (exit page)":"https:\/\/www.opentracker.net\/products\/mobile-app-analytics",
"currentTitle":"Mobile App Analytics | Opentracker Analytics",
"countryName":"United States",
"city":"Lynn Haven",
"region":"Florida",
"isp":"",
"org_company":"Unknown",
"isp/ org":"Wideopenwest",
"provider":"knology.net",
"area code (tel)":"850",
"ZIP/ postal code":"32444",
"referrers Logo":"",
"referrer":"Unknown",
"search term":"Unknown",
"user status":"offline",
"number of visits":"2",
"pageviews":"2",
"total pages viewed":"25",
"last visit duration":"45s",
"current visit duration":"00s",
"total duration":"20m 36s",
"first measurement":"Jul 27 22:34 PM +0500",
"platform/ OS":"Android",
"browser":"Chrome 59.0.3071.125",
"resolution":"1024 x 600",
"IP address":"216.186.130.150"}
,
{
"visit_id":"1123570",
"machine_idx":"867547",
"last event":"Jul 27 22:11 PM +0500",
"duration":"08m 39s",
"country":"\/images\/general\/login\/flags\/US.gif",
"status":"\/images\/general\/login\/puppets\/puppet_offline.png",
"visits(pv)":"3 (6)",
"current page (exit page)":"https:\/\/www.opentracker.net\/thankyou?site=174.255.201.161&email=dickgoesinme1st%40gmail.com&phone=&country=United%20States&city=Lynn%20Haven",
"currentTitle":"Congratulations! | Opentracker Analytics",
"countryName":"United States",
"city":"Lynn Haven",
"region":"Florida",
"isp":"",
"org_company":"Unknown",
"isp/ org":"Wideopenwest",
"provider":"knology.net",
"area code (tel)":"850",
"ZIP/ postal code":"32444",
"referrers Logo":"",
"referrer":"Unknown",
"search term":"Unknown",
"user status":"offline",
"number of visits":"3",
"pageviews":"6",
"total pages viewed":"19",
"last visit duration":"08m 39s",
"current visit duration":"00s",
"total duration":"13m 29s",
"first measurement":"Jul 27 22:02 PM +0500",
"platform/ OS":"Android",
"browser":"Chrome 59.0.3071.125",
"resolution":"534 x 320",
"IP address":"216.186.130.150"}
,
{
"visit_id":"1123289",
"machine_idx":"867318",
"last event":"Jul 27 16:46 PM +0500",
"duration":"s.e.",
"country":"\/images\/general\/login\/flags\/US.gif",
"status":"\/images\/general\/login\/puppets\/puppet_offline.png",
"visits(pv)":"1 (1)",
"current page (exit page)":"https:\/\/www.opentracker.net\/products\/web-analytics\/feature\/ip-address-geo-location",
"currentTitle":"IP address to geo-location - Web Analytics | Opentracker Analytics",
"countryName":"United States",
"city":"Miami",
"region":"Florida",
"isp":"",
"org_company":"Unknown",
"isp/ org":"Assurant",
"provider":"Unknown",
"area code (tel)":"305",
"ZIP/ postal code":"33157",
"referrers Logo":"",
"referrer":"Unknown",
"search term":"Unknown",
"user status":"offline",
"number of visits":"1",
"pageviews":"1",
"total pages viewed":"2",
"last visit duration":"single event( s.e.)",
"current visit duration":"00s",
"total duration":"00s",
"first measurement":"Jul 27 16:46 PM +0500",
"platform/ OS":"iPad 10.3.3",
"browser":"Safari 10.0",
"resolution":"1024 x 768",
"IP address":"167.79.174.22"}
]
}

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
-------------


us
us,fl
us,fl,tampa (case insensitive)

country code,region code,city

us,t (texas and Tennessee) don't need but no problem if we have it


-------------


** important ** .. i'm looking for the last 40 (limit) visits of people who are from TR ordered by date

..
...
....


--------------
for wild cards -> 

solr has all the cities and regions and countries

i do a search for ta on solr -> give a list of every .. with ta in it.

then use this list to do the get.


--------------

..

for wild cards ->

solr has all the search terms (*ta*)

i do a search for ta on solr -> give a list of every . with ta in it. -> .[1000] long -> 1000 range queries on cassandra

then use this list to do the get.


The reason we couldnt use solr was because it is immutable
But the keys are immutable so this should not be a problem


--------------

select * from sessions where ipnumber between x and y order by date; (using filesort)
get * from .- cf where ipnumber between x and y -> list[10,000]; [list ordered by value .] garanteed < 10,000;

memory / key.column value size  = number in list (/2 safety factor).

-> put into cassandra  .


-> select from cassandra list limit 10,000;


** not important ** usecase0a: ... i'm looking for the last 40 (limit) visits of people who are visiting with a search term alphabetically ordered


buckets are used for recency, so that if a key has changing properties in time the bucket can solve this problem. buckets are ordered by date.

** important ** ..  I want to search everyone with first* -> list' of sessions with first*
strat 1: ** important ** .., ..  I want to search everyone with first*, ordered by date -> list' of sessions with first* 
doesnt solve strat 2: ** important ** . { secondary column . } I want to search everyone with first*, ordered by date -> list' of sessions with first* (might be memory problem unsolvable)

doesnt solve strat 2: ** important ** .. { secondary column . } I want to search everyone with first*, ordered by date -> list' of sessions with first* (you cant search on  -> so you cant search on the secondary column)....

hard to solve

-----------------
list' = mechanism that guarantees no memory overload with large lists. So we have a java list that has no memory contraints.
if the list is 10,000 but you get 1000, you'll miss the most recent. (maybe with a bucketing system you can solve this) 
-----------------


-------------
usecase1: i'm looking for a machine id's search visits -> . || get all visits for the machine id and elimenate the non search visits 
usecase2: i'm looking for a machine id's search visits one year ago -> one index ->  get all visits for the machine id and elimenate the non search visits and within time period

-------------
-------------
usecase3: i'm looking for a searched visit_id for a site -> one index . || use session cf and flag on condition its a searcg visit. (deprecate)
-------------
-------------
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. 
-------------

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