Display and analyze trends in website traffic through time.
Display and analyze trends in website traffic through time.
This API produces a json array. Use this URL to perform GET or POST requests.
At least one of the following parameters are required:
date
Calculate trends from specified date entered as yyyy-MM-dd. Default is the current date.
unixTime
Calculate trends from specified unix timestamp. Default is current unix timestamp.
period
Specify the trend period.
timezone
The timezone used. Use this option if more than one timezone is being recorded, by default the site's defined timezone is used.
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.
segment
This is the property field based on which you want to segment the data. By default there are no segments. You can find more information here.
filter
You can choose to see no segments [none] (default), see all segments showAllSorts, or by specifying the name of the segment.
site
The site for which to display data. The 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 | csv | svg | png.
dateFormat
The dateFormat parameter determines the format of dates returned. An example is dateFormat=yyyy-dd-MM. The syntax can be found here.
To calculate the daily trends to the website www.opentracker.net for the user "demo@opentracker.net" with password "demo123":
HTTP GET/ POST: trends.jsp?login=demo@opentracker.net&password=demo123&site=www.opentracker.net&period=1d
To calculate the weekly trends of the week where the date 2024-10-13 falls and display in html:
HTTP GET/ POST:trends.jsp?period=1w&date=2024-10-13&dataType=html
To calculate the monthly trends over a range of 3 months from now/ current month:
HTTP GET/ POST:trends.jsp?period=3m
This last example returns a json array with 'n' entries starting from the specified period formatted as:
{ "resultsList": [ { "No.":"3", "date":"Oct, 2024", "sessions":"65,219", "visitors":"55,821", "first time visitors":"47,109", "returning":"8,712", "referred":"38,879", "searching":"37,342", "exit link":"271", "pageviews":"160,695", "end date":"2024-10-15", "segment":"", "single event sessions":"28,057", "total duration all sessions":"5,398,412", "start date":"2024-10-01", "sessionsWithMoreThanOneEvent":""} , { "No.":"2", "date":"Sep, 2024", "sessions":"136,464", "visitors":"117,164", "first time visitors":"99,102", "returning":"18,062", "referred":"81,895", "searching":"78,872", "exit link":"556", "pageviews":"329,793", "end date":"2024-09-30", "segment":"", "single event sessions":"58,601", "total duration all sessions":"10,632,256", "start date":"2024-09-01", "sessionsWithMoreThanOneEvent":""} , { "No.":"1", "date":"Aug, 2024", "sessions":"132,983", "visitors":"113,243", "first time visitors":"95,232", "returning":"18,011", "referred":"78,020", "searching":"75,433", "exit link":"453", "pageviews":"320,113", "end date":"2024-08-31", "segment":"", "single event sessions":"56,844", "total duration all sessions":"10,263,412", "start date":"2024-08-01", "sessionsWithMoreThanOneEvent":""} , { "No.":"", "date":"", "sessions":"334,666", "visitors":"286,228", "first time visitors":"241,443", "returning":"44,785", "referred":"198,794", "searching":"191,647", "exit link":"1,280", "pageviews":"810,601", "single event sessions":"143,502", "total duration all sessions":"26,294,080", "end date":"", "segment":"", "start date":"", "sessionsWithMoreThanOneEvent":""} ] }
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