You are reviewing MouseStats documentation: Take a look to the product!

Account API

MouseStats provides a powerful API to access account information and some reports. You are allowed to use these API to integrate MouseStats with other products, or possibly use it in your own custom software.

Summary

1. The API endpoint:
/api/accounts/v1/[service]/[action]?secret=[apiSecret]&params

2. You need to make HTTP GET requests to the host: https://api.mousestats.com

3. [service] can be one of the services: "playbacks", "heatmaps", "formanalytics", "surveys". It is depended on your usage and available API functions.

4. [action] is the API function you are calling.

5. [apiSecret] should be generated and configured in your panel. Each API secrent has permission to just ONE project which is defined by you in the API Management in the panel. You may have multiple API Secrets.

6. params will be defined based on the API function you are calling.

Publicly Available APIs

In advanced to the listed API functions, there are other functions which is available in beta or advanced cases. You may need to contact support if you have a particular requirement which can not be satisfied with the following functions.

Playbacks

Get Recorded Sessions

To get latest recorded sessions for a specific visitor or just the latest ones, you can use this API:

/api/accounts/v1/playbacks/sessions?secret=[apiSecret]&identifier=[identifier]


The identifier is used to identify visitors by JavaScript API. To set identifier for each recording, you need to call the following JavaScript where MouseStats tracking script is installed:

MouseStats_Commands.push(["identify", "john.doe@example.com"]);

The identify value can be any parameters which help you to make them recognizable. It can be the userId in your website or support system. Or email address, username or other unique features for a user.
It can be called before or after pageload.


Examples code:

curl https://api.mousestats.com/api/accounts/v1/playbacks/sessions?secret=482516321-2300926ccacdb25f&identifier=john.doe@example.com

Sample JSON Output:

[{
    "Tags": [
        ["paidUser", "yes"],
        ["name", "John Doe"],
        ["_ms_identifier", "john.doe@example.com"]
    ],
    "startTime": "2015-02-28T15:42:46.378Z",
    "pageviews": "6",
    "duration": "1924849", /*duration is in ms. duration/1000 would be in seconds*/
    "playbackUrl": "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=dd1900f87764a53c88a0&r=1&accessKey="
}, {
    "Tags": [
        ["paidUser", "yes"],
        ["_ms_identifier", "john.doe@example.com"]
    ],
    "startTime": "2015-02-28T14:36:57.97Z",
    "pageviews": "3",
    "duration": "2225137",
    "playbackUrl": "http://www.mousestats.com/playbackprojectv2/play/5743116180563719374/?s=d980a1f070f6fa416d01&r=1&accessKey="
}]



Form Analytics

Report

You can access a Form Analytics project report with this API.

/api/accounts/v1/formanalytics/report?secret=[apiSecret]

As the project will be defined in API Management, no additional params is required for this API.


Examples code:

curl https://api.mousestats.com/api/accounts/v1/formanalytics/report?secret=482516321-2300926ccacdb25f

Sample JSON Output:

{
    "count": 26.0,
    "coversionRate": 65.4,
    "correctionRate": 60.0,
    "engagement": 76.9,
    "abandonRate": 11.5,
    "disregard": 23.1,
    "timeInForm": 45.7,
    "formHesitation": 16.0,
    "fieldStats": {
        "dropOutReason": [{
            "_password": 66.6666666666667
        }, {
            "_username": 33.3333333333333
        }, {
            "_remember": 0.0
        }],
        "timeInField": [{
            "_username": 2.8976
        }, {
            "_password": 1.994125
        }, {
            "_remember": 1.0
        }],
        "charactersLength": [{
            "_username": 22.0
        }, {
            "_password": 3.0
        }],
        "editRate": [{
            "_username": 2.29411764705882
        }, {
            "_password": 1.63636363636364
        }, {
            "_remember": 1.5
        }],
        "emptyRate": [{
            "_password": 53.8461538461538
        }, {
            "_username": 15.3846153846154
        }]
    }
}



Error Results

You may receive an error as the output. The error JSON object structure is:

{
    "result": "API secret is invalid.",
    "type": "error",
    "code": 3,
    "more1": "",
    "more2": "",
    "more3": "",
    "more4": ""
}



API Call Limits

The limits are per 15-minute time windows and they will reset on this interval.
  • /playbacks/sessions: 100calls/per 15mins
  • /formanalytics/report: 20calls/per 15mins