Trends

Display and analyze trends in website traffic through time.

Display and analyze trends in website traffic through time.

API Usage

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

Parameters

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. Hourly has extra option of time entered as hh:mm
unixTime Calculate trends from specified unix timestamp. Default is current unix timestamp.
period Specify the trend period.

    • d for days, eg: period=14d will show 14rows with daily trends, period=d defaults to 7 days
    • w for weeks, eg: period=12w will show 12 rows with weekly trends, period=w defaults to 4 weeks
    • m for months, eg: period=4m will show 4 rows with monthly trends, period=m defaults to 3 months

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. Default is [en_US]. A list of locales can be found here.
ignoreLocale Display columns without language translation. [false]|true.
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 calculate the today's summary trends of website www.opentracker.net for user "demo@opentracker.net" with password "demo123":
HTTP GET/ POST: trends_summary.jsp?login=demo@opentracker.net&password=demo123&site=www.opentracker.net

To calculate the weekly summary trends of 2023-11-29 and display in html:
HTTP GET/ POST:trends_summary.jsp?date=2023-11-29&period=1w&dataType=html

To calculate the monthly trends over a range of 3 months :
HTTP GET/ POST:trends_summary.jsp?period=3m&trend=daily

Response

This last example returns a json array with 'n' entries starting from the specified date and period formatted as:

{ "resultsList": [
{
"description":"selected period",
"selected period":"2023-09-01 - 2023-11-29",
"period before":"2023-06-01 - 2023-08-31"}
,
{
"description":"unique visitors",
"selected period":"384,901",
"period before":"510,720"}
,
{
"description":"pageviews",
"selected period":"1,155,808",
"period before":"1,524,109"}
,
{
"description":"returning visitors",
"selected period":"64694 (16.81%)",
"period before":"80047 (15.67%)"}
,
{
"description":"pageviews per visitor (avg)",
"selected period":"3",
"period before":"2.98"}
,
{
"description":"time viewing per page (avg)",
"selected period":"31s",
"period before":"29s"}
,
{
"description":"number of visits",
"selected period":"448,635",
"period before":"589,965"}
,
{
"description":"number of single event visits (s.e.)",
"selected period":"167,849",
"period before":"219,314"}
,
{
"description":"visit time (avg): single event (s.e.) visits excluded",
"selected period":"02m 08s",
"period before":"02m 03s"}
,
{
"description":"bounce rate percentage",
"selected period":"37.41%",
"period before":"37.17%"}
,
{
"description":"sum total time of all visits added up",
"selected period":"52 days 7h 41m 45s",
"period before":"163 days 19h 37m 47s"}
,
{
"description":"number of visits per unique visitor (avg)",
"selected period":"1.17",
"period before":"1.16"}
,
{
"description":"pageviews per visit (avg)",
"selected period":"2.58",
"period before":"2.58"}
,
{
"description":"visits coming from referring links",
"selected period":"298425 (66.52%)",
"period before":"406181 (68.85%)"}
,
{
"description":"visits coming from search engines",
"selected period":"289839 (64.6%)",
"period before":"396839 (67.26%)"}
,
{
"description":"visits by typing address, using bookmark, or referred by email",
"selected period":"150210 (33.48%)",
"period before":"183784 (31.15%)"}
,
{
"description":"visits leaving through exit links",
"selected period":"1996 (0.44%)",
"period before":"2005 (0.34%)"}
,
{
"description":"average time on site",
"selected period":"01m 20s",
"period before":"01m 17s"}
,
{
"description":"first time visitors",
"selected period":"320,207",
"period before":"430,673"}
,
{
"description":"first measurement",
"selected period":"January 20, 2015",
"period before":"January 20, 2015 (Tuesday) 7:52:48 PM"}
]
}

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

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