Page Views Per Day

We track the number of times our script is initialized on your site. We call these “page views”. Comparing page views versus number of errors is a great health metric. We store the page view counts rolled up by day.

This endpoint returns the page view counts per day, sorted by date descending.

Url

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/hits/daily

Parameters

The following parameters may be specified on the query string to further filter the results. All parameters shown here are optional.

Date Range

startDate: Default value if not specified is the beginning of time.

endDate: Default value if not specified is the current date.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/hits/daily?startDate=2014-08-01&endDate=2014-08-31

Paging

By default the endpoint returns the most recent 20 results. You may adjust the number of results, and also specify a different page, if the number of total results exceed what you’ve requested.

page The page of data you’re requesting. Default value is 1 if not specified.

size The number of results to return per request. The default value is 20. The maximum value is 1000.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/hits/daily?page=2&size=100

Applications

If you make use of multiple applications, you specify which application key you’d like to receive data for.

application The application key to request data for. If not specified you will receive all data for all applications.

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/hits/daily?application=Prod

Example

Request

GET https://api.trackjs.com/{CUSTOMER_ID}/v1/hits/daily?startDate=2014-09-01&size=3

Response

{

    "data": [
        {
            "key": "2014-09-12T00:00:00Z",
            "count": 2835
        },
        {
            "key": "2014-09-11T00:00:00Z",
            "count": 3890
        },
        {
            "key": "2014-09-10T00:00:00Z",
            "count": 3577
        }
    ],
    "metadata": {
        "startDate": "2014-09-01T00:00:00Z",
        "totalCount": 11,
        "page": 1,
        "size": 3,
        "hasMore": true
    }

}