Getting statistics data¶
Getting daily/hourly devices statistics¶
To get the daily/hourly count of detected and authenticated devices within given date range you can use the /venue-devices-history/ endpoint returning a devices-history object:
GET /analytics/venue-devices-history/VENUE_ID/?from=FROM_DATE&to=TO_DATE
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-devices-history/VENUE_ID/?from=2021-03-11&to=2021-04-09" \
| jq
Response
{
"data": {
"type": "venue-devices-history",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"detected": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
],
"unique-detected": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
],
"unique-authenticated": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
],
"authenticated": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
]
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting devices statistics summary¶
To get summary statistics you can use the /venue-devices-summary/ endpoint returning a devices-summary:
GET /analytics/venue-devices-summary/VENUE_ID/
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-devices-summary/VENUE_ID/" \
| jq
Response
{
"data": {
"type": "venue-devices-summary",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"detected": 18,
"unique-detected": 2,
"unique-authenticated": 0,
"authenticated": 0
}
},
"jsonapi": {
"version": "1.0"
}
}
Available filters¶
| Key | Example | Description |
|---|---|---|
from |
?from=2021-03-11 |
Limit summary data with from date. |
to |
&to=2021-04-09 |
Limit summary data with to date. |
Getting daily/hourly user login statistics¶
The /venue-users-history/ endpoint works similarly as for devices, just that it returns
users-history object.
GET /analytics/venue-users-history/VENUE_ID/?from=FROM_DATE&to=TO_DATE
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-users-history/VENUE_ID/?from=2021-03-11&to=2021-04-09" \
| jq
Response
{
"data": {
"type": "venue-users-history",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"logins": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
],
"unique-logins": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
]
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting user login methods statistics¶
You can use the /venue-users-login-methods/ endpoint to get
users-login-methods statistics.
GET /analytics/venue-users-login-methods/VENUE_ID/?from=2021-03-11&to=2021-04-09
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-users-login-methods/VENUE_ID/?from=2021-03-11&to=2021-04-09" \
| jq
Response
{
"data": {
"type": "venue-users-login-methods",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"email": 2,
"facebook": 0,
"phone": 0,
"autologin": 0,
"linkedin": 0,
"google": 0,
"twitter": 0
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting user accounts activation statistics¶
User that use email to log in must confirm the email address before it becomes usable by Social WiFi content mailing system etc.
This endpoint returns users-status object - count of activated and not activated accounts for given date range.
Deprecation warning - this endpoint is deprecated. Use (users-summary) unique-logins and confirmed-users.
GET /analytics/venue-users-status/VENUE_ID/?from=2021-03-11&to=2021-04-09
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-users-status/VENUE_ID/?from=2021-03-11&to=2021-04-09" \
| jq
Response
{
"data": {
"type": "venue-users-status",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"inactive": 2,
"active": 0
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting user accounts activation statistics¶
Summary statistics of logins, unique logins and activations (users-summary) for a venue can be fetched like so:
GET /analytics/venue-users-summary/VENUE_ID/
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
https://api.socialwifi.com/analytics/venue-users-summary/VENUE_ID/ \
| jq
Available filters¶
| Key | Example | Description |
|---|---|---|
from |
?from=2021-03-11 |
Limit summary data with from date. |
to |
&to=2021-04-09 |
Limit summary data with to date. |
Response
{
"data": {
"type": "venue-users-summary",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"logins": 10,
"unique-logins": 6,
"confirmed-users": 2,
"returning-users": 1
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting remarketing scripts usage statistics¶
Each time remarketing code is embedded on a page it usage is counted and available as remarketing-history statistic.
GET /analytics/venue-remarketing-history/VENUE_ID/?from=2021-03-11&to=2021-03-15
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/venue-remarketing-history/VENUE_ID/?from=2021-03-11&to=2021-03-15" \
| jq
Response
{
"data": {
"type": "venue-remarketing-history",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"embeds": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
],
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting daily/hourly rates statistics¶
If you have rating emails enabled you can get rating-history statistics data:
GET /analytics/rating-history/VENUE_ID/?from=2021-03-11&to=2021-03-15
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/rating-history/VENUE_ID/?from=2021-03-11&to=2021-03-15" \
| jq
Response
{
"data": {
"type": "rating-history",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"rates-average": [
[
"2021-03-11T00:00:00+00:00",
null
],
[
"2021-03-12T00:00:00+00:00",
null
],
[
"2021-03-13T00:00:00+00:00",
null
],
[
"2021-03-14T00:00:00+00:00",
null
],
[
"2021-03-15T00:00:00+00:00",
null
]
],
"rates-count": [
[
"2021-03-11T00:00:00+00:00",
0
],
[
"2021-03-12T00:00:00+00:00",
0
],
[
"2021-03-13T00:00:00+00:00",
0
],
[
"2021-03-14T00:00:00+00:00",
0
],
[
"2021-03-15T00:00:00+00:00",
0
]
]
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting rates statistics summary¶
This endpoint returns rating-summary - an average rate for a venue as well as amount of rates for given rate (1-5).
GET /analytics/rating-summary/VENUE_ID/?from=2021-03-11&to=2021-03-15
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/analytics/rating-summary/VENUE_ID/?from=2021-03-11&to=2021-03-15" \
| jq
Response
{
"data": {
"type": "rating",
"id": "22222222-2222-2222-2222-222222222222",
"attributes": {
"rates_count": 0,
"average_rate": 0,
"rates_per_value": [
[
1,
0
],
[
2,
0
],
[
3,
0
],
[
4,
0
],
[
5,
0
]
]
}
},
"jsonapi": {
"version": "1.0"
}
}
Getting rating statistics summary¶
This endpoint returns rating-statistics-summary - amount of rating requests sent, opened, rated and commented:
GET /statistics/rating-statistics-summaries/?filter[venue]=VENUE_ID&from=2021-03-11&to=2021-04-09
curl \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Accept: application/vnd.api+json" \
"https://api.socialwifi.com/statistics/rating-statistics-summaries/?filter\[venue\]=VENUE_ID&from=2021-03-11&to=2021-04-09" \
| jq
Response
{
"data": [
{
"type": "rating-statistics-summary",
"id": "a52edbcb-ec9d-41c3-9aaf-7558a9546317",
"attributes": {
"requests-commented": 0,
"requests-sent": 34,
"requests-opened": 0,
"requests-rated": 33
},
"relationships": {
"venue": {
"data": {
"type": "venues",
"id": "22222222-2222-2222-2222-222222222222"
}
}
}
}
],
"meta": {
"count": 1
},
"jsonapi": {
"version": "1.0"
}
}
Project statistics endpoints¶
Projects have a set of look-alike endpoints:
- /analytics/project-devices-history/ (devices-history)
- /analytics/project-devices-summary/ (devices-summary)
- /analytics/project-users-history/ (users-history)
- /analytics/project-users-login-methods/ (users-login-methods)
- /analytics/project-users-status/ (users-status) (deprecated)
- /analytics/project-users-summary/ (users-summary)
- /analytics/project-remarketing-history/ (remarketing-history)
- /analytics/rating-project-history/ (rating-history)
- /analytics/rating-project-summary/ (rating-summary)
They return data from all project venues you have access to.