Analytics
All analytics endpoints have path prefix /analytic-service. User must have report_viewer role from a participant to request analytics.
Optional parameters from_date (2000-01-01 by default) and to_date (2100-01-01 by default) may be used to restrict analyzed time period.
Custom filtering based on participant index schema may be used with all endpoints by means of optional filter value. It's a JSON object value where keys are field names as they are in participant index schema (see fields value in participant index schema in Index service API). Only products with the specified values will be counted.
Some analytics endpoints support analytics based on Shping events. To
activate events analytics, use_events
must be set to true
in
requests. from_date
and to_date
are in participant timezone in
that case. All events based analytics endpoints support filtering by
country
and brand
, no other filtering fields are supported. Many
endpoints, when in use_events
mode have additional data in the
response, but keep the same fields as in non-use_events
mode for
compatibility.
Number of Scans
By Month
Number of scans grouped by month. Response will contain months
array
of data points. Each entry contain year
and month
fields, along
with the number of scans
and the number of distinct users who made
the scans in num_users
. Additionally there are num_impressions
(total number of approved reward actions for the scans) and actions
(total number of reward actions by type) fields. Entries are ordered
by year
and month
.
POST /analytic-service/scans/get_months
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count scans from date |
to_date |
string | Count scans to date |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2019-01-01",
"months": [
{
"actions": {
"visit_link": 7,
"visit_social_networks_link": 50
},
"month": 1,
"num_impressions": 687,
"num_users": 56,
"scans": 1031,
"year": 2019
},
{
"actions": {
"visit_link": 2,
"visit_social_networks_link": 4
},
"month": 2,
"num_impressions": 338,
"num_users": 45,
"scans": 657,
"year": 2019
},
{
"actions": {
"visit_link": 5,
"visit_social_networks_link": 23
},
"month": 3,
"num_impressions": 523,
"num_users": 72,
"scans": 1213,
"year": 2019
}
],
"to_date": "2019-03-31"
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"months": [
{
"actions": {
"visit_link": 1,
"visit_social_networks_link": 0
},
"impressions": {
"cross_market": 0,
"cross_market_link": 15,
"product": 582,
"timeline": 99
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 2,
"click_timeline_product": 1,
"click_timeline_review": 0,
"scan": 54,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 1,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 8,
"num_impressions": 681,
"num_interactions": 58,
"num_users": 14,
"scans": 54,
"year": 2020
},
{
"actions": {
"visit_link": 69,
"visit_social_networks_link": 200
},
"impressions": {
"cross_market": 0,
"cross_market_link": 21,
"product": 10847,
"timeline": 3884
},
"interactions": {
"click_2scan": 10,
"click_cross_market": 0,
"click_feat_product": 144,
"click_gdti": 4,
"click_timeline_product": 149,
"click_timeline_review": 62,
"scan": 843,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 65,
"visit_social_networks_link": 170,
"watch_video": 12
},
"month": 9,
"num_impressions": 17296,
"num_interactions": 1459,
"num_users": 246,
"scans": 843,
"year": 2020
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
By Week
Number of scans grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number from 1 to 53) fields, along with the number of scans and the number of distinct users who made the scans. Entries are ordered by year and week.
POST /analytic-service/scans/get_weeks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2019-03-01",
"to_date": "2019-03-31",
"weeks": [
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 1
},
"num_impressions": 45,
"num_users": 7,
"scans": 55,
"week": 9,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 8
},
"num_impressions": 123,
"num_users": 10,
"scans": 322,
"week": 10,
"year": 2019
},
{
"actions": {
"visit_link": 2,
"visit_social_networks_link": 3
},
"num_impressions": 99,
"num_users": 19,
"scans": 201,
"week": 11,
"year": 2019
},
{
"actions": {
"visit_link": 3,
"visit_social_networks_link": 10
},
"num_impressions": 119,
"num_users": 37,
"scans": 328,
"week": 12,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 1
},
"num_impressions": 137,
"num_users": 25,
"scans": 307,
"week": 13,
"year": 2019
}
]
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15",
"weeks": [
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"impressions": {
"cross_market": 0,
"cross_market_link": 1,
"product": 0,
"timeline": 4
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 0,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"num_impressions": 4,
"num_interactions": 0,
"num_users": 0,
"scans": 0,
"week": 33,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"impressions": {
"cross_market": 0,
"cross_market_link": 7,
"product": 151,
"timeline": 6
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 2,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 14,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"num_impressions": 157,
"num_interactions": 16,
"num_users": 4,
"scans": 14,
"week": 34,
"year": 2020
},
{
"actions": {
"visit_link": 1,
"visit_social_networks_link": 0
},
"impressions": {
"cross_market": 0,
"cross_market_link": 5,
"product": 186,
"timeline": 88
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 1,
"click_timeline_review": 0,
"scan": 27,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 1,
"visit_social_networks_link": 0,
"watch_video": 0
},
"num_impressions": 274,
"num_interactions": 29,
"num_users": 11,
"scans": 27,
"week": 35,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"impressions": {
"cross_market": 0,
"cross_market_link": 3,
"product": 380,
"timeline": 6
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 1,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 17,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"num_impressions": 386,
"num_interactions": 18,
"num_users": 4,
"scans": 17,
"week": 36,
"year": 2020
},
{
"actions": {
"visit_link": 56,
"visit_social_networks_link": 188
},
"impressions": {
"cross_market": 0,
"cross_market_link": 25,
"product": 10112,
"timeline": 3812
},
"interactions": {
"click_2scan": 6,
"click_cross_market": 0,
"click_feat_product": 140,
"click_gdti": 1,
"click_timeline_product": 145,
"click_timeline_review": 59,
"scan": 830,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 52,
"visit_social_networks_link": 158,
"watch_video": 7
},
"num_impressions": 16489,
"num_interactions": 1398,
"num_users": 243,
"scans": 830,
"week": 37,
"year": 2020
},
{
"actions": {
"visit_link": 13,
"visit_social_networks_link": 12
},
"impressions": {
"cross_market": 0,
"cross_market_link": 7,
"product": 600,
"timeline": 67
},
"interactions": {
"click_2scan": 4,
"click_cross_market": 0,
"click_feat_product": 3,
"click_gdti": 3,
"click_timeline_product": 4,
"click_timeline_review": 3,
"scan": 9,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 13,
"visit_social_networks_link": 12,
"watch_video": 5
},
"num_impressions": 667,
"num_interactions": 56,
"num_users": 3,
"scans": 9,
"week": 38,
"year": 2020
}
]
}
By Day
Number of scans grouped by day of month. Response will contain days array of data points. Each entry contain year, month and day fields, along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the date.
POST /analytic-service/scans/get_days
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"days": [
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 1
},
"day": 20,
"month": 3,
"num_impressions": 3,
"num_users": 3,
"scans": 51,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 3
},
"day": 21,
"month": 3,
"num_impressions": 41,
"num_users": 9,
"scans": 58,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 1
},
"day": 22,
"month": 3,
"num_impressions": 5,
"num_users": 9,
"scans": 48,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 23,
"month": 3,
"num_impressions": 2,
"num_users": 3,
"scans": 4,
"year": 2019
},
{
"actions": {
"visit_link": null,
"visit_social_networks_link": null
},
"day": 24,
"month": 3,
"num_impressions": 0,
"num_users": 1,
"scans": 11,
"year": 2019
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 1
},
"day": 25,
"month": 3,
"num_impressions": 17,
"num_users": 9,
"scans": 26,
"year": 2019
}
],
"from_date": "2019-03-20",
"to_date": "2019-03-25"
}
Example Response (with use_events
)
{
"days": [
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 16,
"impressions": {
"cross_market": 0,
"cross_market_link": 1,
"product": 0,
"timeline": 4
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 0,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 8,
"num_impressions": 4,
"num_interactions": 0,
"num_users": 0,
"scans": 0,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 23,
"impressions": {
"cross_market": 0,
"cross_market_link": 0,
"product": 0,
"timeline": 1
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 0,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 8,
"num_impressions": 1,
"num_interactions": 0,
"num_users": 0,
"scans": 0,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 24,
"impressions": {
"cross_market": 0,
"cross_market_link": 4,
"product": 29,
"timeline": 43
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 4,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 8,
"num_impressions": 72,
"num_interactions": 4,
"num_users": 2,
"scans": 4,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 31,
"impressions": {
"cross_market": 0,
"cross_market_link": 3,
"product": 245,
"timeline": 1
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 13,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 8,
"num_impressions": 246,
"num_interactions": 13,
"num_users": 3,
"scans": 13,
"year": 2020
},
{
"actions": {
"visit_link": 0,
"visit_social_networks_link": 0
},
"day": 4,
"impressions": {
"cross_market": 0,
"cross_market_link": 5,
"product": 135,
"timeline": 5
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 1,
"click_gdti": 0,
"click_timeline_product": 0,
"click_timeline_review": 0,
"scan": 4,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"month": 9,
"num_impressions": 140,
"num_interactions": 5,
"num_users": 1,
"scans": 4,
"year": 2020
}
],
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
In a Period
Number of scans in the specified period ungrouped. Response will
contain periods
array of data points. The single entry in this array
contains the number of scans
and the number of distinct users who
made the scans in num_users
field.
POST /analytic-service/scans/get_period
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count scans from date |
to_date |
string | Count scans to date |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2019-09-25",
"periods": [
{
"num_users": 493,
"scans": 20188
}
]
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"periods": [
{
"actions": {
"visit_link": 33,
"visit_social_networks_link": 17
},
"impressions": {
"cross_market": 0,
"cross_market_link": 7,
"product": 2838,
"timeline": 248
},
"interactions": {
"click_2scan": 5,
"click_cross_market": 0,
"click_feat_product": 9,
"click_gdti": 6,
"click_timeline_product": 9,
"click_timeline_review": 3,
"scan": 86,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 33,
"visit_social_networks_link": 17,
"watch_video": 13
},
"num_impressions": 3086,
"num_interactions": 181,
"num_users": 24,
"scans": 86
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
By Country
Number of scans grouped by country. Response will contain countries array of data points. Each entry contain country field (country code or null if there were no country associated with a scan), along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the number of scans. Number of returned results may be limited with the limit argument (100 by default).
POST /analytic-service/scans/get_countries
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
country |
string | Only count scans in this country. |
limit | number | Limit the number of returned countries |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"limit": 100,
"countries": [
{
"num_users": 31,
"country": "036",
"scans": 45
},
{
"num_users": 18,
"country": "156",
"scans": 40
},
{
"num_users": 22,
"country": "724",
"scans": 32
}
]
}
By State
Number of scans grouped by a region in a country. Response will
contain states
array of data points. Each entry contain state
field (name of the region or null
if there were no region associated
with a scan), along with the number of scans
and the number of
distinct users who made the scans in the num_users
field. Entries
are ordered by the number of scans. Number of returned results may be
limited with the limit
argument (100 by default). If country
is
omitted from request, states in all countries are considered.
POST /analytic-service/scans/get_states
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count scans from date |
to_date |
string | Count scans to date |
country |
string | Group scans by states in country with this code |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
limit |
number | Limit the number of returned states |
Example Response
{
"country": "036",
"from_date": "2017-01-01",
"limit": 100,
"states": [
{
"country": "036",
"num_users": 121,
"scans": 5198,
"state": null
},
{
"country": "036",
"num_users": 1,
"scans": 4,
"state": "Victoria"
}
]
}
By City
Number of scans grouped by a city. Response will contain cities
array of data points. Each entry contain city
field (name of the
city or null
if there were no city associated with a scan), along
with the number of scans
and the number of distinct users who made
the scans. Entries are ordered by the number of scans. Number of
returned results may be limited with the limit
argument (100 by
default). If country
isn't defined, cities in all countries are
considered.
POST /analytic-service/scans/get_cities
Parameters
| Name | Type | Description |
| :--------------------00--------: | :----: | :-------------------------------------------------------------------: |
| authenticateit_identity_ticket
| header | Required: Session's ticket |
| from_date
| string | Count scans from date |
| to_date
| string | Count scans to date |
| country
| string | Group scans by cities in country with this code |
| filter
| string | Custom participant specific filtering e.g. {“field_a”:“some_value”}
|
| limit
| number | Limit the number of returned cities |
Example Response
{
"cities": [
{
"city": "Melbourne",
"country": "036",
"num_users": 47,
"scans": 2715
},
{
"city": null,
"country": "036",
"num_users": 69,
"scans": 1577
},
{
"city": "Brighton",
"country": "036",
"num_users": 2,
"scans": 126
},
{
"city": "Elsternwick",
"country": "036",
"num_users": 3,
"scans": 63
},
{
"city": "Yarraville",
"country": "036",
"num_users": 8,
"scans": 55
}
],
"country": "036",
"limit": 100
}
By Shop
Number of scans grouped by retailer stores. Response will contain
shops
array of data points. Each entry contain shop
field (name of
the shop or null
if there were no such information associated with
the scan), along with the number of scans
and the number of distinct
users in the num_users
field. Entries are ordered by the number of
scans. Number of returned results may be limited with the limit
argument (100 by default). If country
and/or city
aren't
specified, shops in all countries and cities are considered.
POST /analytic-service/scans/get_shops
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count scans from date |
to_date |
string | Count scans to date |
country |
string | Group scans by cities in country with this code |
city |
string | Group scans by shops in this city |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
limit |
number | Limit the number of returned shops |
Example Response
{
"city": "Melbourne",
"country": "036",
"limit": 100,
"shops": [
{
"city": "Melbourne",
"country": "036",
"num_users": 47,
"scans": 2715,
"shop": null
},
{
"city": "Melbourne",
"country": "036",
"num_users": 3,
"scans": 6,
"shop": "Sth melbourne supermarket"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 2,
"scans": 3,
"shop": "Food Puzzle"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 2,
"scans": 3,
"shop": "IGA X-press"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 2,
"shop": "Coles South Melbourne"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 2,
"shop": "Dafeng Supermarket"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 2,
"shop": "Feilong Fair Price Supermarket"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "7-Eleven South Yarra"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "Blink Beautifully"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "Chevron IGA X-press"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "Coles Caringbah"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "IGA Yarraville"
},
{
"city": "Melbourne",
"country": "036",
"num_users": 1,
"scans": 1,
"shop": "Shanghai Supe Chemical Co.,Ltd."
}
]
}
Coordinates of the Latest Scans
Coordinates of the latest scans of participant products. Response
contains array coordinates
of scan entries. Each entry has
latitude
, longitude
and accuracy
of scan coordinates, along with
the ts
(timestamp) of the scan. Entries are ordered by the
timestamp. Number of returned entries may be limited with the limit
parameter (100 entries are returned by default).
POST /analytic-service/scans/get_coordinates
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Select only scans from the date |
to_date |
string | Select only scans to the date |
country |
string | Select only scans in this country |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
limit |
number | Limit the number of returned scans |
Example Response
{
"coordinates": [
{
"accuracy": 57.2879981994629,
"latitude": 56.853523,
"longitude": 53.298828,
"ts": "2019-09-12T11:26:54Z"
},
{
"accuracy": 16,
"latitude": 56.853301,
"longitude": 53.299013,
"ts": "2019-09-12T11:11:32Z"
},
{
"accuracy": 16,
"latitude": 56.853301,
"longitude": 53.299013,
"ts": "2019-09-12T10:47:52Z"
},
{
"accuracy": 200,
"latitude": 0,
"longitude": 0,
"ts": "2019-08-21T07:08:36Z"
},
{
"accuracy": 29.0939998626709,
"latitude": 56.838757,
"longitude": 53.245748,
"ts": "2019-08-21T06:58:58Z"
},
{
"accuracy": 65,
"latitude": 56.838684,
"longitude": 53.245463,
"ts": "2019-08-21T06:55:09Z"
},
{
"accuracy": 29.0939998626709,
"latitude": 56.838757,
"longitude": 53.245748,
"ts": "2019-08-21T06:53:34Z"
},
{
"accuracy": 24.4769992828369,
"latitude": 56.838759,
"longitude": 53.245729,
"ts": "2019-08-21T05:24:23Z"
},
{
"accuracy": 31.5139999389648,
"latitude": 56.838747,
"longitude": 53.24582,
"ts": "2019-08-21T04:07:05Z"
},
{
"accuracy": 27.9559993743896,
"latitude": 56.838759,
"longitude": 53.245818,
"ts": "2019-08-15T10:22:11Z"
},
{
"accuracy": 28.0230007171631,
"latitude": 56.838775,
"longitude": 53.24581,
"ts": "2019-08-15T10:20:07Z"
},
{
"accuracy": 16,
"latitude": 56.853348,
"longitude": 53.299278,
"ts": "2019-08-14T09:39:40Z"
},
{
"accuracy": 57.935001373291,
"latitude": 56.853525,
"longitude": 53.298926,
"ts": "2019-08-14T09:37:54Z"
},
{
"accuracy": 63.4459991455078,
"latitude": 56.853516,
"longitude": 53.298714,
"ts": "2019-08-14T09:36:18Z"
},
{
"accuracy": 63.2999992370605,
"latitude": 56.853573,
"longitude": 53.298793,
"ts": "2019-08-14T09:31:34Z"
}
]
}
Example Response (with use_events
)
{
"coordinates": [
{
"accuracy": 21.6219997406006,
"interaction": "scan",
"latitude": 56.838742,
"longitude": 53.246041,
"ts": "2020-09-13T07:12:01Z"
},
{
"accuracy": 17.4349994659424,
"interaction": "watch_video",
"latitude": 56.838682,
"longitude": 53.24581,
"ts": "2020-09-11T07:05:41Z"
},
{
"accuracy": 17.4349994659424,
"interaction": "click_feat_product",
"latitude": 56.838682,
"longitude": 53.24581,
"ts": "2020-09-11T07:04:41Z"
},
{
"accuracy": 18.2430000305176,
"interaction": "visit_link",
"latitude": 56.838689,
"longitude": 53.245913,
"ts": "2020-09-11T07:04:03Z"
},
{
"accuracy": 18.2430000305176,
"interaction": "watch_video",
"latitude": 56.838689,
"longitude": 53.245913,
"ts": "2020-09-11T07:02:48Z"
},
{
"accuracy": 19.4969997406006,
"interaction": "watch_video",
"latitude": 56.838679,
"longitude": 53.245767,
"ts": "2020-09-09T12:07:34Z"
},
{
"accuracy": 65,
"interaction": "scan",
"latitude": 56.838745,
"longitude": 53.245569,
"ts": "2020-08-25T14:02:22Z"
}
],
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
By User Age
Number of scans grouped by user age. Response will contain ages array of data points. Each entry contain age field (age of the users or null for users with unspecified birthdate), along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the age value. User scans may be filtered by user gender and/or user Shping level.
POST /analytic-service/scans/users/get_ages
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
gender | string | Only count scans by users of this gender |
level | string | Only count scans by users of this level |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"ages": [
{
"num_users": 1,
"age": null,
"scans": 1
},
{
"num_users": 1,
"age": 15,
"scans": 3
},
{
"num_users": 2,
"age": 16,
"scans": 8
},
{
"num_users": 1,
"age": 22,
"scans": 8
}
],
"from_date": "2000-01-01",
"to_date": "2100-01-01"
}
Example Response (with use_events
)
{
"ages": [
{
"age": 15,
"num_impressions": 7,
"num_interactions": 1,
"num_users": 1,
"scans": 1
},
{
"age": 20,
"num_impressions": 13,
"num_interactions": 2,
"num_users": 2,
"scans": 2
},
{
"age": 21,
"num_impressions": 90,
"num_interactions": 11,
"num_users": 1,
"scans": 1
},
{
"age": 24,
"num_impressions": 140,
"num_interactions": 5,
"num_users": 1,
"scans": 4
},
{
"age": 25,
"num_impressions": 347,
"num_interactions": 19,
"num_users": 1,
"scans": 13
},
{
"age": 33,
"num_impressions": 421,
"num_interactions": 37,
"num_users": 1,
"scans": 7
},
{
"age": 39,
"num_impressions": 161,
"num_interactions": 11,
"num_users": 1,
"scans": 4
},
{
"age": 69,
"num_impressions": 184,
"num_interactions": 12,
"num_users": 1,
"scans": 3
},
{
"age": null,
"num_impressions": 434,
"num_interactions": 23,
"num_users": 8,
"scans": 5
}
],
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
By User Generation
Number of scans grouped by user generation. Response will contain
generations
array of data points. Each entry contain generation
field (generation based on user birthdate, null
for users with
undefined birthdate, or whose birthdate couldn't be classified), along
with the number of scans
and the number of distinct users who made
the scans. Entries are in no particular order. User scans may be
filtered by user gender and/or user Shping level.
POST /analytic-service/scans/users/get_generations
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count scans from date |
to_date |
string | Count scans to date |
gender |
string | Only count scans by users of this gender |
level |
string | Only count scans by users of this level |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"generations": [
{
"generation": null,
"num_users": 350,
"scans": 7547
},
{
"generation": "Baby Boomers",
"num_users": 8,
"scans": 5238
},
{
"generation": "Generation X",
"num_users": 32,
"scans": 1044
},
{
"generation": "Generation Z",
"num_users": 34,
"scans": 2817
},
{
"generation": "Millennials",
"num_users": 30,
"scans": 489
}
],
"from_date": "2000-01-01",
"to_date": "2100-01-01"
}
Example Response (with use_events
)
{
"generations": [
{
"generation": null,
"num_users": 6,
"num_impressions": 0,
"num_interactions": 19
"scans": 3
},
{
"generation": "Generation X",
"num_users": 4,
"num_impressions": 0,
"num_interactions": 17
"scans": 4
},
{
"generation": "Millennials",
"num_users": 2,
"num_impressions": 0,
"num_interactions": 8
"scans": 1
}
],
"from_date": "2020-11-18",
"to_date": "2020-11-18",
"timezone": "Africa/Addis_Ababa"
}
By User Gender
Number of scans grouped by user gender. Response will contain genders array of data points. Each entry contain gender field (users gender or null for users with unspecified gender), along with the number of scans and the number of distinct users who made the scans. Entries are in no particular order. User scans may be filtered by user Shping level.
POST /analytic-service/scans/users/get_genders
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
level | string | Only count scans by users of this level |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2000-01-01",
"genders": [
{
"num_users": 45,
"gender": null,
"scans": 155
},
{
"num_users": 19,
"gender": "male",
"scans": 43
},
{
"num_users": 136,
"gender": "female",
"scans": 438
}
],
"to_date": "2100-01-01"
}
Example Response (with use_events
)
{
"genders": [
{
"num_users": 1,
"num_impressions": 0,
"num_interactions": 3,
"gender": null,
"scans": 0
},
{
"num_users": 3,
"num_impressions": 0,
"num_interactions": 12,
"gender": "female",
"scans": 8
},
{
"num_users": 3,
"num_impressions": 0,
"num_interactions": 13,
"gender": "male",
"scans": 3
},
{
"num_users": 1,
"num_impressions": 0,
"num_interactions": 2,
"gender": "other",
"scans": 1
}
],
"from_date": "2020-11-18",
"to_date": "2020-11-18",
"timezone": "Africa/Addis_Ababa"
}
By User Level
Number of scans grouped by user level. Response will contain levels array of data points. Each entry contain level field (users Shping level or null for users with no level), along with the number of scans and the number of distinct users who made the scans. Entries are in no particular order.
POST /analytic-service/scans/users/get_levels
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
country |
string | Only count scans in this country. |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2000-01-01",
"levels": [
{
"num_users": 5,
"level": null,
"scans": 11
},
{
"num_users": 77,
"level": "bronze",
"scans": 115
},
{
"num_users": 2,
"level": "gold",
"scans": 13
}
],
"to_date": "2100-01-01"
}
Top by Number of Scans
Top Products
Top products by number of scans or by number of impressions. Response
will contain products array of data points. Along with the number of
scans, number of impressions and the number of distinct users who made
the scans each entry contain product information fields id
(product
GTIN), brand
(product brand, or null
if unspecified), name
(product name), image
(product image, if available), featured
(true
for scans of featured product). Entries are sorted by number
of scans by default (may be changed with sort_by
parameter). Number
of returned entries may be limited with the limit
argument (10 by
default). Number of entries may be skipped from the response using the
offset
argument (0 by default). Parameters offset
and limit
may
be used for pagination. Response also has the total number of products
in the count
field.
For featured
product entries, there will be also
featured_campaigns
field. Each campaign entry has start_time
,
end_time
and even_distribution
(if this field is true
, the
campaign has even_distribution
option, if this field is false
or
missing, the campaign has single_blast
option set).
Each product entry also includes impressions and interactions counters
grouped by event stream (scan
— ogranic scans stream, featured
or
blast
— featured products traffic) in the streams
field.
POST /analytic-service/scans/products/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
country |
string | Only count scans in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
limit |
number | Limit the number of returned products |
offset |
number | Skip specified number of products from the response |
sort_by |
string | Sort either by number of "scans" or by "num_impressions" |
Example Response
{
"count": 16,
"limit": 3,
"offset": 0,
"products": [
{
"actions": {
"send_review": 21,
"visit_link": 13,
"visit_social_networks_link": 17,
"watch_video": 2
},
"brand": null,
"featured": false,
"id": "08383451070009",
"image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
"name": "Lay's \"Зеленый лук\" 550г",
"num_impressions": 368,
"num_sales": 0,
"num_users": 40,
"scans": 115
},
{
"actions": {
"send_review": 5,
"visit_link": 13,
"visit_social_networks_link": 7,
"watch_video": 1
},
"brand": "Wild Brand",
"featured": false,
"id": "08383451333319",
"image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
"name": "Lay's \"Зеленый лук\" 150г",
"num_impressions": 155,
"num_sales": 0,
"num_users": 23,
"scans": 96
},
{
"actions": {
"send_review": 15,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"brand": "Wild Brand",
"featured": false,
"id": "08383451362388",
"image": "https://dev-cdn.shping.com/2019/6/28/e692e739-b072-4bfb-8eb8-fa24a809da79.jpg",
"name": "Ice-cream",
"num_impressions": 70,
"num_sales": 0,
"num_users": 23,
"scans": 73
}
],
"sort_by": "scans"
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"limit": 10,
"offset": 0,
"products": [
{
"actions": {
"send_review": 0,
"visit_link": 11,
"visit_social_networks_link": 12,
"watch_video": 3
},
"brand": "Wild Brand",
"featured": false,
"id": "00080687360871",
"image": "https://dev-cdn.shping.com/2020/9/14/f8afa5b8-4cb3-4363-b52c-2b43d21aac86.png",
"impressions": {
"cross_market": 0,
"cross_market_link": 8,
"product": 347,
"timeline": 29
},
"interactions": {
"click_2scan": 4,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 2,
"click_timeline_product": 1,
"click_timeline_review": 3,
"scan": 6,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 11,
"visit_social_networks_link": 12,
"watch_video": 3
},
"name": "Sticky",
"num_impressions": 376,
"num_interactions": 42,
"num_sales": 0,
"num_users": 4,
"scans": 6,
"streams": {
"other": {
"num_impressions": 376,
"num_interactions": 42
}
}
},
{
"actions": {
"send_review": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"brand": "Wild Brand",
"featured": true,
"featured_campaigns": [
{
"start_time": "2020-11-30T20:00:00Z",
"end_time": "2021-02-06T19:59:59Z"
},
{
"start_time": "2020-11-30T20:00:00Z",
"end_time": "2021-02-03T23:59:59Z",
"even_distribution": true
}
],
"id": "00080687360895",
"image": "https://dev-cdn.shping.com/2020/9/14/d9d89391-0a5f-4e4c-be7c-28443fa59102.jpg",
"impressions": {
"cross_market": 0,
"cross_market_link": 4,
"product": 139,
"timeline": 20
},
"interactions": {
"click_2scan": 0,
"click_cross_market": 0,
"click_feat_product": 0,
"click_gdti": 0,
"click_timeline_product": 3,
"click_timeline_review": 0,
"scan": 2,
"send_review": 0,
"submit_todo_card": 0,
"visit_link": 0,
"visit_social_networks_link": 0,
"watch_video": 0
},
"name": "EK product",
"num_impressions": 159,
"num_interactions": 5,
"num_sales": 0,
"num_users": 2,
"scans": 2,
"streams": {
"scan": {
"num_impressions": 155,
"num_interactions": 3
},
"featured": {
"num_impressions": 4,
"num_interactions": 2
}
}
}
],
"sort_by": "num_interactions",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
Top Users
Top users by number of scans. Response will contain users array of
data points. Along with the number of scans each entry contain user
information fields id
(Shping user id), first_name
, email
,
gender
, level
, image
, age
. Entries are sorted by number of
scans. Number of returned entries may be limited with the limit
argument (10 by default).
POST /analytic-service/scans/users/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
from_date | string | Count scans from date |
to_date | string | Count scans to date |
filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
country |
string | Only count scans in this country. |
limit | number | Limit the number of returned users |
Example Response
{
"from_date": "2000-01-01",
"limit": 10,
"to_date": "2100-01-01",
"users": [
{
"age": null,
"email": "xyz@foo.bar",
"first_name": "Joe",
"gender": null,
"id": "urn:authenticateit:user:email:xyz@foo.bar",
"level": null,
"image": null,
"scans": 11
},
{
"age": 19,
"email": "j@aaa.cn",
"first_name": "Jane",
"gender": "female",
"id": "urn:authenticateit:user:email:j@aaa.cn",
"level": null,
"image": "http://example.com/profile_pictures/xiang.jpg",
"scans": 8
}
]
}
Top Products by Number of Sales
Top products from analyzed receipts for participant. Response contains
list of products
. Each entry contain product information fields id
(product GTIN), brand
(product brand, or null
if unspecified),
name
(product name), image
(product image, if available). Entries
are sorted by num_sales
by default (may be changed with sort_by
parameter). Number of returned entries may be limited with the limit
argument (10 by default). Number of entries may be skipped from the
response using the offset
argument (0 by default).
POST /analytic-service/sales/products/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count sales from this date |
to_date |
string | Count sales to this date |
country |
string | Only count receipts in this country. |
limit |
number | Limit the number of returned products |
offset |
number | Skip specified number of products from the response |
sort_by |
string | Sort either by "num_sales" or by "amount" |
Example Response
{
"from_date": "2019-03-01",
"to_date": "2020-01-11",
"limit": 10,
"offset": 0,
"products": [
{
"amount": 24.64,
"brand": "Wild Brand",
"id": "08383451333319",
"image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
"num_sales": 16
},
{
"amount": 3.65,
"brand": null,
"id": "00000000000017",
"image": null,
"num_sales": 5
},
{
"amount": 9.7,
"brand": null,
"id": "00000093558037",
"image": null,
"num_sales": 2
},
{
"amount": 3.98,
"brand": null,
"id": "00000000000949",
"image": null,
"num_sales": 2
},
{
"amount": 10.98,
"brand": null,
"id": "00000000000819",
"image": null,
"num_sales": 2
},
{
"amount": 1,
"brand": null,
"id": "00000000055987",
"image": null,
"num_sales": 1
},
{
"amount": 3.5,
"brand": null,
"id": "00000000032995",
"image": null,
"num_sales": 1
},
{
"amount": 0.85,
"brand": null,
"id": "00000000001328",
"image": null,
"num_sales": 1
}
],
"sort_by": "num_sales",
}
Top Videos by Number of Views
Top viewed videos from widgets in participant scanned
products. Response contains list of videos
. Each entry has video
url
, title
(may be null
), preview
(preview image URL, may be
null
), num_users
and num_views
. Entries ordered by the
num_views
.
POST /analytic-service/claims/watch_video/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count video views from this date |
to_date |
string | Count video views to this date |
country |
string | Only count video views in this country. |
limit |
number | Limit the number of returned videos |
Example Response
{
"from_date": "2019-01-01",
"to_date": "2019-03-01",
"videos": [
{
"num_users": 8,
"num_views": 9,
"preview": "https://dev-cdn.shping.com/2019/1/6/6b02e0de-1fb0-4094-a8cd-45f66dc8b3c7",
"title": "Our promo video",
"url": "https://dev-cdn.shping.com/2019/1/6/8e8628a5-a939-4911-8c38-138c17a64f30.mp4"
},
{
"num_users": 2,
"num_views": 4,
"preview": "https://dev-cdn.shping.com/2019/2/5/1530f2c3-7ffa-4404-acd4-5113f4a75133",
"title": "Video 2 ",
"url": "https://dev-cdn.shping.com/2019/2/5/37c7ef63-bc43-4dac-86fa-bf3f18bdfc16.mp4"
},
{
"num_users": 2,
"num_views": 2,
"preview": "https://cdn.shping.com/2018/11/1/51189279-84d7-42f0-9aea-71aaa99c2df0",
"title": "New from SkinB5 - Superfood Booster",
"url": "https://cdn.shping.com/2018/11/1/b3909016-92c4-42ac-b2b9-72a950b0b23e.mp4"
}
]
}
Top Visited Links
Top visited links from widgets in participant scanned products. Links
in follow_fb
, link
, social_networks
widgets are taken into
account. Response contains list of links
. Each entry has link url
,
text
(may be null
), num_users
and num_visits
. Entries ordered
by the num_visits
.
Additional grouping by month, week or day may be requested with
group_by
parameter. Each link record will contain months
, weeks
or days
list of entries. There is no additional grouping by default,
it must be requested explicitly.
POST /analytic-service/claims/visit_link/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count video views from this date |
to_date |
string | Count video views to this date |
country |
string | Only count video views in this country. |
brand |
string | Only count scans for this brand (for events analytics) |
limit |
number | Limit the number of returned videos |
group_by |
string | Additionally group visits by month , week or day |
Example Response
{
"from_date": "2019-12-01",
"to_date": "2019-12-25",
"links": [
{
"days": [
{
"day": 25,
"month": 12,
"num_visits": 2,
"year": 2019
}
],
"num_users": 2,
"num_visits": 2,
"text": "Отдельный виджет Link",
"url": "http://shping.com"
},
{
"days": [
{
"day": 18,
"month": 12,
"num_visits": 1,
"year": 2019
},
{
"day": 25,
"month": 12,
"num_visits": 1,
"year": 2019
}
],
"num_users": 2,
"num_visits": 2,
"text": "web",
"url": "http://lays.ru"
},
{
"days": [
{
"day": 25,
"month": 12,
"num_visits": 1,
"year": 2019
}
],
"num_users": 1,
"num_visits": 1,
"text": "Link to scan 08383451070009",
"url": "https://dev-api.shping.com/authentication-service/capture_link/get/5a73a0ee-4267-429a-8968-ac944af64599"
}
]
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"links": [
{
"days": [
{
"day": 25,
"month": 8,
"num_visits": 1,
"year": 2020
},
{
"day": 9,
"month": 9,
"num_visits": 4,
"year": 2020
},
{
"day": 10,
"month": 9,
"num_visits": 6,
"year": 2020
},
{
"day": 11,
"month": 9,
"num_visits": 3,
"year": 2020
},
{
"day": 14,
"month": 9,
"num_visits": 9,
"year": 2020
}
],
"num_users": 9,
"num_visits": 23,
"text": "WCO link with GIF ",
"url": "http://www.shping.com"
},
{
"days": [
{
"day": 9,
"month": 9,
"num_visits": 2,
"year": 2020
},
{
"day": 10,
"month": 9,
"num_visits": 3,
"year": 2020
},
{
"day": 11,
"month": 9,
"num_visits": 1,
"year": 2020
},
{
"day": 14,
"month": 9,
"num_visits": 2,
"year": 2020
}
],
"num_users": 6,
"num_visits": 8,
"text": "Our Web Site",
"url": "https://www.shping.com"
},
{
"days": [
{
"day": 14,
"month": 9,
"num_visits": 4,
"year": 2020
}
],
"num_users": 3,
"num_visits": 4,
"text": "Scan Analytics WCO product2",
"url": "https://dev-api.shping.com/authentication-service/capture_link/get/062d4e3f-339f-4819-a934-0d61c4e06cf7"
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
Spent Coins
Number of coins spent by participant's campaigns.
Reward campaigns may be filtered with the same set of parameters as in
API to list reward campaigns. Filtering
parameters are audience
, events
, start_date
and end_date
. Only coins
spent by filtered campaigns will be accounted in the result.
Coins are reported in the smallest coin units, and represented either
as integer or as a string of digits. To convert from the smallest coin
units to coins, numbers should be divided by 10E18
.
Response entries may contain estimations on the amounts spent in AUD
(in the aud
field), if such information is available.
When using events analytics (use_events
in requests), there are
additional impressions
and interactions
fields with spendings by
event type. Field streams
has the same data as impressions
and
interactions
, but also grouped by event stream (scan
— ogranic
scans stream, featured
— featured products traffic, competitor
—
competitor traffic, product_match
— products match traffic,
shopping_list
— shopping lists traffic, other
— other
traffic). Fields aud
is in dollars, and amount
is the same amount
represented as integer microdollars. coins
are always zero for
events based analytics.
In use_events
mode, filtering by products
(non-empty list of
GTINs) is available. For now it queries events data directly instead
of using precomputed analytics data, and it will take much longer to
process a request with products
filter.
By Month
Number of coins spent by participant's campaigns, grouped by month. Response will contain months array of data points. Each entry contain year and month fields, along with the number of coins. Entries are ordered by year and month.
POST /analytic-service/spendings/get_months
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count spent coins from date |
to_date | string | Count spent coins to date |
country |
string | Only count scans in this country |
brand |
string | Only count scans for this brand (for events analytics) |
products |
array | Only count events for these GTINs (for events analytics) |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"months": [
{
"year": 2017,
"month": 4,
"coins": 77000000,
"aud": null
},
{
"year": 2017,
"month": 5,
"coins": "8900000000000000000",
"aud": 1.32
}
]
}
Example Response (with use_events
)
{
"from_date": "2020-11-04",
"months": [
{
"amount": 10005000,
"aud": 10.005,
"coins": 0,
"impressions": {
"product": {
"amount": 543000,
"aud": 0.543,
"coins": 0,
"num_events": 181
},
"timeline": {
"amount": 12000,
"aud": 0.012,
"coins": 0,
"num_events": 4
}
},
"interactions": {
"click_cross_market": {
"amount": 2100000,
"aud": 2.1,
"coins": 0,
"num_events": 7
},
"click_gdti": {
"amount": 300000,
"aud": 0.3,
"coins": 0,
"num_events": 1
},
"send_review": {
"amount": 800000,
"aud": 0.8,
"coins": 0,
"num_events": 2
},
"visit_link": {
"amount": 1200000,
"aud": 1.2,
"coins": 0,
"num_events": 4
},
"visit_social_networks_link": {
"amount": 3300000,
"aud": 3.3,
"coins": 0,
"num_events": 11
},
"watch_video": {
"amount": 1750000,
"aud": 1.75,
"coins": 0,
"num_events": 5
}
},
"streams": {
"scan": {
"impressions": {
"product": {
"amount": 543000,
"aud": 0.543,
"coins": 0,
"num_events": 181
}
},
"interactions": {
"click_cross_market": {
"amount": 2100000,
"aud": 2.1,
"coins": 0,
"num_events": 7
},
"visit_link": {
"amount": 1200000,
"aud": 1.2,
"coins": 0,
"num_events": 4
},
"visit_social_networks_link": {
"amount": 3300000,
"aud": 3.3,
"coins": 0,
"num_events": 11
},
"watch_video": {
"amount": 1750000,
"aud": 1.75,
"coins": 0,
"num_events": 5
}
}
},
"other": {
"impressions": {
"timeline": {
"amount": 12000,
"aud": 0.012,
"coins": 0,
"num_events": 4
}
},
"interactions": {
"click_gdti": {
"amount": 300000,
"aud": 0.3,
"coins": 0,
"num_events": 1
},
"send_review": {
"amount": 800000,
"aud": 0.8,
"coins": 0,
"num_events": 2
}
}
}
},
"month": 11,
"year": 2020
}
],
"timezone": "Asia/Yerevan",
"to_date": "2020-11-06"
}
By Week
Number of coins spent by participant's campaigns, grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number from 1 to 53) fields, along with the number of coins. Entries are ordered by year and week.
POST /analytic-service/spendings/get_weeks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count spent coins from date |
to_date | string | Count spent coins to date |
country |
string | Only count scans in this country |
brand |
string | Only count scans for this brand (for events analytics) |
products |
array | Only count events for these GTINs (for events analytics) |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"weeks": [
{
"year": 2017,
"week": 3,
"coins": 450000000,
"aud": null
},
{
"year": 2017,
"week": 4,
"coins": "33000000000",
"aud": 0.05
}
]
}
Example Response (with use_events
)
{
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15",
"weeks": [
{
"amount": 12000,
"aud": 0.012,
"coins": 0,
"impressions": {
"timeline": {
"amount": 12000,
"aud": 0.012,
"coins": 0,
"num_events": 4
}
},
"week": 33,
"year": 2020
},
{
"amount": 1122000,
"aud": 1.1219999999999999,
"coins": 0,
"impressions": {
"product": {
"amount": 558000,
"aud": 0.5579999999999999,
"coins": 0,
"num_events": 186
},
"timeline": {
"amount": 264000,
"aud": 0.264,
"coins": 0,
"num_events": 88
}
},
"interactions": {
"visit_link": {
"amount": 300000,
"aud": 0.3,
"coins": 0,
"num_events": 1
}
},
"week": 35,
"year": 2020
},
{
"amount": 12592000,
"aud": 12.591999999999999,
"coins": 0,
"impressions": {
"product": {
"amount": 1905000,
"aud": 1.9049999999999998,
"coins": 0,
"num_events": 635
},
"timeline": {
"amount": 237000,
"aud": 0.237,
"coins": 0,
"num_events": 79
}
},
"interactions": {
"click_gdti": {
"amount": 900000,
"aud": 0.8999999999999999,
"coins": 0,
"num_events": 3
},
"visit_link": {
"amount": 4200000,
"aud": 4.2,
"coins": 0,
"num_events": 14
},
"visit_social_networks_link": {
"amount": 3600000,
"aud": 3.5999999999999996,
"coins": 0,
"num_events": 12
},
"watch_video": {
"amount": 1750000,
"aud": 1.75,
"coins": 0,
"num_events": 5
}
},
"week": 38,
"year": 2020
}
]
}
By Day
Number of coins spent by participant's campaigns, grouped by day of month. Response will contain days array of data points. Each entry contain year, month and day fields, along with the number of coins. Entries are ordered by the date.
POST /analytic-service/spendings/get_days
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date | string | Count spent coins from date |
to_date | string | Count spent coins to date |
country |
string | Only count scans in this country |
brand |
string | Only count scans for this brand (for events analytics) |
products |
array | Only count events for these GTINs (for events analytics) |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"days": [
{
"year": 2017,
"month": 4,
"day": 28,
"coins": "1300000000000000",
"aud": 0.07
},
{
"year": 2017,
"month": 5,
"day": 3,
"coins": "1500000000000000",
"aud": 0.07
},
{
"year": 2017,
"month": 5,
"day": 4,
"coins": 50000000123,
"aud": null
}
]
}
Example Response (with use_events
)
{
"days": [
{
"amount": 3000,
"aud": 0.003,
"coins": 0,
"day": 23,
"impressions": {
"timeline": {
"amount": 3000,
"aud": 0.003,
"coins": 0,
"num_events": 1
}
},
"month": 8,
"year": 2020
},
{
"amount": 216000,
"aud": 0.216,
"coins": 0,
"day": 24,
"impressions": {
"product": {
"amount": 87000,
"aud": 0.087,
"coins": 0,
"num_events": 29
},
"timeline": {
"amount": 129000,
"aud": 0.129,
"coins": 0,
"num_events": 43
}
},
"month": 8,
"year": 2020
},
{
"amount": 738000,
"aud": 0.738,
"coins": 0,
"day": 25,
"impressions": {
"product": {
"amount": 354000,
"aud": 0.354,
"coins": 0,
"num_events": 118
},
"timeline": {
"amount": 84000,
"aud": 0.08399999999999999,
"coins": 0,
"num_events": 28
}
},
"interactions": {
"visit_link": {
"amount": 300000,
"aud": 0.3,
"coins": 0,
"num_events": 1
}
},
"month": 8,
"year": 2020
}
],
"from_date": "2020-08-15",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
By Reward Action
Number of coins spent by participant's campaigns, grouped by rewarded
user action. Response will contain actions
array of data
points. Each entry contain action
field, along with the number of
coins
spent and the num_impressions
. By default, entries are
ordered by the coins
.
When using events analytics (use_events
in requests), there is
periods
array with the single period record. The record spent
amounts per impressions
and interactions
.
POST /analytic-service/spendings/get_actions
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count spent coins from date |
to_date |
string | Count spent coins to date |
country |
string | Only count scans in this country |
brand |
string | Only count scans for this brand (for events analytics) |
products |
array | Only count events for these GTINs (for events analytics) |
sort_by |
string | Sort by coins or by num_impressions |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"actions": [
{
"action": null,
"aud": null,
"coins": "5888272000000000000000000",
"num_impressions": 233
},
{
"action": "scan",
"aud": 0.01,
"coins": "1054041000000000000000000",
"num_impressions": 1203
},
{
"action": "watch_video",
"aud": null,
"coins": "28461000000000000000000",
"num_impressions": 29
},
{
"action": "send_scan_location",
"aud": null,
"coins": "13523000000000000000000",
"num_impressions": 32
},
{
"action": "view_image",
"aud": null,
"coins": "9464000000000000000000",
"num_impressions": 361
},
{
"action": "visit_social_networks_link",
"aud": null,
"coins": "8582000000000000000000",
"num_impressions": 73
},
{
"action": "send_review",
"aud": null,
"coins": "8064000000000000000000",
"num_impressions": 204
},
{
"action": "view_text",
"aud": null,
"coins": "2286293000000000000000",
"num_impressions": 249
},
{
"action": "view_nutrition_info",
"aud": null,
"coins": "989000000000000000000",
"num_impressions": 56
},
{
"action": "visit_link",
"aud": 0,
"coins": "292000000000000000000",
"num_impressions": 50
},
{
"action": "view_certificates",
"aud": 0,
"coins": "155000000000000000000",
"num_impressions": 175
},
{
"action": "view_popup",
"aud": null,
"coins": "22000000000000000000",
"num_impressions": 12
},
{
"action": "follow_fb",
"aud": 0,
"coins": "17000000000000000000",
"num_impressions": 11
}
]
}
Example Response (with use_events
)
{
"actions": [
{
"action": "visit_link",
"amount": 10200000,
"aud": 10.2,
"coins": 0,
"num_events": 34,
"num_impressions": 0
},
{
"action": "visit_social_networks_link",
"amount": 5100000,
"aud": 5.1,
"coins": 0,
"num_events": 17,
"num_impressions": 0
},
{
"action": "watch_video",
"amount": 4550000,
"aud": 4.55,
"coins": 0,
"num_events": 13,
"num_impressions": 0
}
],
"from_date": "2020-08-15",
"periods": [
{
"amount": 31049000,
"aud": 31.049,
"coins": 0,
"impressions": {
"product": {
"amount": 8619000,
"aud": 8.619,
"coins": 0,
"num_events": 2873
},
"timeline": {
"amount": 780000,
"aud": 0.7799999999999999,
"coins": 0,
"num_events": 260
}
},
"interactions": {
"click_gdti": {
"amount": 1800000,
"aud": 1.7999999999999998,
"coins": 0,
"num_events": 6
},
"visit_link": {
"amount": 10200000,
"aud": 10.2,
"coins": 0,
"num_events": 34
},
"visit_social_networks_link": {
"amount": 5100000,
"aud": 5.1,
"coins": 0,
"num_events": 17
},
"watch_video": {
"amount": 4550000,
"aud": 4.55,
"coins": 0,
"num_events": 13
}
}
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-15"
}
Product Sales
By Month
Information on participant's product sales grouped by month. Response
will contain months
array of data points. Each entry contain year
and month
fields, along with the num_sales
(number of times
participant products appeared in user receipts) and amount
(monetary
amount of total spendings from user receipts). Entries are ordered by
year
and month
.
POST /analytic-service/sales/get_months
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count sales from date |
to_date |
string | Count sales to date |
country |
string | Only count sales in this country |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"months": [
{
"amount": "19.46",
"month": 9,
"num_sales": 10,
"year": 2019
}
],
"from_date": "2000-01-01",
"to_date": "2100-01-01"
}
By Week
Participant products sales grouped by week. Response will contain
weeks
array of data points. Each entry contain year
and week
(week number from 1 to 53) fields, along with num_sales
number of
sales and total monetary amount
. Entries are ordered by year
and
week
.
POST /analytic-service/sales/get_weeks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count sales from date |
to_date |
string | Count sales to date |
country |
string | Only count sales in this country |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"from_date": "2000-01-01",
"to_date": "2100-01-01",
"weeks": [
{
"amount": "19.46",
"num_sales": 10,
"week": 37,
"year": 2019
}
]
}
By Day
Information on participant products sales grouped by date. Response
will contain days
array of data points. Each entry contain year
,
month
and day
fields, along with the num_sales
number of sales
and total monetary amount
. Entries are ordered by the date.
POST /analytic-service/sales/get_days
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count sales from date |
to_date |
string | Count sales to date |
country |
string | Only count sales in this country |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
Example Response
{
"days": [
{
"amount": "19.46",
"day": 10,
"month": 9,
"num_sales": 10,
"year": 2019
}
],
"from_date": "2000-01-01",
"to_date": "2100-01-01"
}
By Brand
Participant products sales grouped by brand. Response will contain
brands
array of data points. Each entry contain brand
(brand name,
may be null
if unknown) and image
(URL for brand logo, if
available), along with the num_sales
(number of times product
appeared in user receipts) and amount
(total monetary amount from
user receipts) fields. Entries are ordered by amount
and
num_sales
. Number of returned brands
may be limited with the
limit
parameter (100 by default).
Additional grouping by month, week or day may be requested with
group_by
parameter. Each brand entry will contain months
, weeks
or days
array of entries.
POST /analytic-service/sales/get_brands
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
use_events |
boolean | Events based analytics |
from_date |
string | Count sales from date |
to_date |
string | Count sales to date |
country |
string | Only count sales in this country |
brand |
string | Only count scans for this brand (for events analytics) |
filter |
string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |
limit |
number | Limit the number of returned brands |
group_by |
string | Additional grouping by month , week or day |
Example Response
{
"brands": [
{
"amount": "19.46",
"brand": "XyzCo",
"image": "https://example.com/xyzco.jpg,
"num_sales": 10,
"months": [
{
"amount": 1.00,
"month": 6,
"num_sales": 1,
"year": 2019
},
{
"amount": 8.00,
"month": 8,
"num_sales": 2,
"year": 2019
},
{
"amount": 10.46,
"month": 9,
"num_sales": 7,
"year": 2019
}
]
}
],
"from_date": "2000-01-01",
"to_date": "2100-01-01"
}
Number of Unique Users
Number of unique users in Shping events. Data for this analytics is
always from events, so use_events
doens't make sense here.
Unique users from all event types are counted, not only users from interaction events.
By Month
Number of unique users grouped by month. Response will contain
months
array of data points. Each entry contain year
and month
fields, along with the number of unique users in num_users
.
POST /analytic-service/unique_users/get_months
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count from date |
to_date |
string | Count to date |
country |
string | Only count users in this country. |
brand |
string | Only count users for this brand. |
Example Response
{
"from_date": "2020-08-30",
"months": [
{
"month": 8,
"num_users": 3,
"year": 2020
},
{
"month": 9,
"num_users": 1,
"year": 2020
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05"
}
By Week
Number of unique users grouped by week. Response will contain weeks
array of data points. Each entry has year
and week
(week number
from 1 to 53) fields, along with the number of unique users. Entries
are ordered by year and week.
POST /analytic-service/unique_users/get_weeks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count from date |
to_date |
string | Count to date |
country |
string | Only count users in this country. |
brand |
string | Only count users for this brand. |
Example Response
{
"from_date": "2020-08-30",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05",
"weeks": [
{
"num_users": 4,
"week": 36,
"year": 2020
}
]
}
By Day
Number of unique users grouped by day of month. Response will contain
days
array of data points. Each entry contain year
, month
and
day
fields, along with the number of unique users. Entries are
ordered by the date.
POST /analytic-service/unique_users/get_days
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count from date |
to_date |
string | Count to date |
country |
string | Only count users in this country. |
brand |
string | Only count users for this brand. |
Example Response
{
"days": [
{
"day": 31,
"month": 8,
"num_users": 3,
"year": 2020
},
{
"day": 4,
"month": 9,
"num_users": 1,
"year": 2020
}
],
"from_date": "2020-08-30",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05"
}
In a Period
Number of unique users in the specified period. Response will contain
periods
array of data points. The single entry in the array contains
the number of unique users in num_users
field.
POST /analytic-service/unique_users/get_period
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count from date |
to_date |
string | Count to date |
country |
string | Only count users in this country. |
brand |
string | Only count users for this brand. |
Example Response
{
"from_date": "2020-08-30",
"periods": [
{
"num_users": 4
}
],
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05"
}
Top Cross Marketing Products
Top cross marketing products for the participant, based on Shping
events. Data for this analytics is always from events, so use_events
doens't make sense here.
Cross marketing statistics may be grouped either by product
(competitor GTINs, by default) or by document
(GDTIs attached to
competitor GTINs). The desired grouping may be requested with
group_by
parameter.
When grouped by product
, response will contain products
array of
data points. Each entry contain id
, brand
, name
and image
of
competitor's product. For each product num_visits
(number of
Click2Scan link visits from the product), num_impressions
(number of
times Click2Scan link were presented in the competitor's product scan
results) and num_interactions
(number of interactions with the
participant's product since visit from competitor's product) are
tracked. Entries are sorted by num_interactions
.
When grouped by document
, response will contain documents
array of
entries. Each entry has id
(document GDTI), title
(in the same
format as in GDTI documents) and image
. Fields num_visits
,
num_impressions
and num_interactions
are the same, as in case of
product
grouping.
POST /analytic-service/cross_marketing/get_top
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count from date |
to_date |
string | Count to date |
country |
string | Only count events in this country. |
brand |
string | Only count events for this brand. |
limit |
number | Limit the number of returned products |
offset |
number | Skip specified number of products from the response |
group_by |
string | Group by "product" or by "document" |
Example Response (group_by
product
)
{
"products": [
{
"id": "08383451362388",
"brand": "Wild Brand",
"image": "https://dev-cdn.shping.com/2019/6/28/e692e739-b072-4bfb-8eb8-fa24a809da79.jpg",
"name": "Ice-cream",
"num_visits": 15,
"num_impressions": 921,
"num_interactions": 721
},
{
"id": "08383451070009",
"brand": "Wild Brand",
"image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
"name": "Lay's \"Зеленый лук\" 550г",
"num_visits": 11,
"num_impressions": 784,
"num_interactions": 501
}
],
"from_date": "2020-08-30",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05",
"offset": 0,
"limit": 10
}
Example Response (group_by
document
)
{
"documents": [
{
"id": "urn:epc:id:gdti:49.0000000008.219777573096494",
"title": "Cross market to WCO",
"image": "http://cdn.shping.com/2020/12/07/abc.jpg",
"num_visits": 15,
"num_impressions": 921,
"num_interactions": 721
},
{
"id": "urn:epc:id:gdti:0000.00000008.964199099214673",
"title": {
"en": "Cross market web widget check",
"ru": "Проверка Cross Marketing виджета"
},
"image": null,
"num_visits": 11,
"num_impressions": 784,
"num_interactions": 501
}
],
"from_date": "2020-08-30",
"timezone": "Africa/Addis_Ababa",
"to_date": "2020-09-05",
"offset": 0,
"limit": 10
}
Number of Impressions
User must have rewards_admin
role from a participant to access these
endpoints.
Reward campaigns may be filtered with the same set of parameters as in
API to list reward campaigns. Filtering
parameters are audience
, events
, start_date
and end_date
. Only
impressions related to the filtered campaigns will be counted in the
result.
By Month
Total number of impressions for participant campaigns, grouped by
month. Response will contain months
array of data points. Each entry
contain year
and month
fields, along with the num_impressions
number. Entries are ordered by year
and month
.
POST /analytic-service/impressions/get_months
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Counting starting from date |
to_date |
string | Counting up to date |
country |
string | Only count scans in this country |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2019-01-01",
"months": [
{
"month": 1,
"num_impressions": 571,
"year": 2019
},
{
"month": 2,
"num_impressions": 218,
"year": 2019
},
{
"month": 3,
"num_impressions": 426,
"year": 2019
},
{
"month": 4,
"num_impressions": 204,
"year": 2019
},
{
"month": 5,
"num_impressions": 282,
"year": 2019
},
{
"month": 6,
"num_impressions": 316,
"year": 2019
}
],
"to_date": "2019-06-30"
}
By Week
Total number of impressions for participant campaigns, grouped by
week. Response will contain weeks
array of data points. Each entry
contain year
and week
(week number in a year) fields, along with
the num_impressions
number. Entries are ordered by year
and
week
.
POST /analytic-service/impressions/get_weeks
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Counting starting from date |
to_date |
string | Counting up to date |
country |
string | Only count scans in this country |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2019-06-01",
"to_date": "2019-06-30",
"weeks": [
{
"num_impressions": 57,
"week": 23,
"year": 2019
},
{
"num_impressions": 249,
"week": 24,
"year": 2019
},
{
"num_impressions": 3,
"week": 25,
"year": 2019
},
{
"num_impressions": 7,
"week": 26,
"year": 2019
}
]
}
By Day
Total number of impressions for participant campaigns, grouped by
date. Response will contain days
array of data points. Each entry
contain year
, month
and day
fields, along with the
num_impressions
number. Entries are ordered by year
, month
and
day
.
POST /analytic-service/impressions/get_days
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Counting starting from date |
to_date |
string | Counting up to date |
country |
string | Only count scans in this country |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"days": [
{
"day": 3,
"month": 6,
"num_impressions": 6,
"year": 2019
},
{
"day": 4,
"month": 6,
"num_impressions": 2,
"year": 2019
},
{
"day": 5,
"month": 6,
"num_impressions": 2,
"year": 2019
},
{
"day": 6,
"month": 6,
"num_impressions": 2,
"year": 2019
},
{
"day": 7,
"month": 6,
"num_impressions": 6,
"year": 2019
},
{
"day": 8,
"month": 6,
"num_impressions": 39,
"year": 2019
},
{
"day": 10,
"month": 6,
"num_impressions": 7,
"year": 2019
},
{
"day": 11,
"month": 6,
"num_impressions": 7,
"year": 2019
},
{
"day": 12,
"month": 6,
"num_impressions": 157,
"year": 2019
},
{
"day": 13,
"month": 6,
"num_impressions": 37,
"year": 2019
},
{
"day": 14,
"month": 6,
"num_impressions": 41,
"year": 2019
},
{
"day": 17,
"month": 6,
"num_impressions": 1,
"year": 2019
},
{
"day": 18,
"month": 6,
"num_impressions": 1,
"year": 2019
},
{
"day": 20,
"month": 6,
"num_impressions": 1,
"year": 2019
},
{
"day": 26,
"month": 6,
"num_impressions": 7,
"year": 2019
}
],
"from_date": "2019-06-01",
"to_date": "2019-06-30"
}
Reward Indicators
Number of approved reward campaign events (impressions), number of all reward campaign events offered to users (issued), and number of coins spent for approved campaign events. All the numbers are for requested date range (from_date and to_date parameters). Response will contain num_impressions, num_issued and coins fields. The fields may be null if there is no data for the requested time period (e.g., from_date is in the future).
User must have rewards_admin role from a participant to access this endpoint.
Reward campaigns may be filtered with the same set of parameters as in
API to list reward campaigns. Filtering
parameters are audience
, events
, start_date
and end_date
. Only
indicators related to the filtered campaigns will be included in the
result.
POST /analytic-service/rewards/get_indicators
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
from_date | string | Counting starting from date |
to_date | string | Counting up to date |
audience |
JSON | Filter campaigns by audience |
events |
JSON | Filter campaigns by events |
start_date |
string | Filter campaigns by start date |
end_date |
string | Filter campaigns by end_date |
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"num_impressions": 998,
"num_issued": 131893,
"coins": "432800000012315"
}
User Activities
List of scans made by users. The result is a JSON object with scans
list of entries. Each entry contains scan information fields and user
information in the field user
.
The resulting entries may be filtered by date and time of the scan
(from_date
and to_date
parameters), by scan information (scan
parameter which is a JSON object) and by user information (user
parameter, JSON object).
To get information on a particular scan with id "12345"
, send
{"scan": {"id": "12345"}}
as the request body. Only entries for this
scan will be included in the result.
To filter activities by user profile use user
parameter. It must be
a JSON object with the following fields (all optional): country
,
language
, city
, gender
, min_age
, max_age
, level
. E.g., to
get activities of male users from Melbourne older than 26 years, send
{"user": {"gender": "male", "city": "Melbourne", "min_age": 27}}
.
To get information on activities of a particular user with id
"67890"
, send {"user": {"id": "67890"}}
. Only entries related
to this user will be included in the result.
Parameters offset
and limit
(both optional, having default values
of 0 and 100) may be used for pagination.
To access this endpoint user must have report_viewer
role from the
system participant.
POST /analytic-service/scans/users/get_activities
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Filter entries by date range |
to_date |
string | Filter entries by date range |
scan |
JSON | Filter entries by scan data |
user |
JSON | Filter entries by user data |
offset |
number | Skip specified number of entries. |
limit |
number | Limit the number of returned entries. |
Example Request
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"user": {
"gender": "male",
"city": "Melbourne",
"min_age": 27
}
}
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"scans": [
{
"accuracy": 65,
"code": "00000026033419",
"id": "4d4206e3-c70c-4c17-b87a-108863aaa10d",
"latitude": 56838680,
"longitude": 53245517,
"coins": "1512311241411313",
"status": {
"icon": "not_recalled",
"title": "Not recalled"
},
"ts": "2017-10-03T05:29:18Z",
"user": {
"birthdate": "1985-07-27",
"city": "Melbourne",
"country": "043",
"email": "xyz@foo.bar",
"first_name": "Jonh",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@foo.bar",
"language": "en",
"last_name": "Doe",
"level": "platinum",
"phone": null
}
}
]
}
Alerts
Alert entries in all alert methods may be filtered by date with
from_date
and to_date
parameters.
The number of returned entries may be limited with limit
parameter
(100 by default).
All alert methods require report_viewer
role from the system
participant.
Number of Scans per Day
Maximum number of scans per day analytics. Returns list of alert
entries in scans
field. Each entry has date
, scans
(number of
scans on that date), user
(user who made all the scans). Entries are
ordered by the number of scans in the scans
field.
POST /analytic-service/alerts/get_scans_per_day
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
country |
string | Filter alert entries by country |
city |
string | Filter alert entries by city |
limit |
1.. | Limit number of returned alert entries |
Example Request
{
"from_date": "2017-10-01",
"country": "036",
"limit": 5
}
Example Response
{
"scans": [
{
"date": "2017-10-04",
"scans": 35,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-04",
"scans": 4,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-06",
"scans": 2,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-05",
"scans": 1,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-05",
"scans": 1,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
}
]
}
Number of Scans per Location
Maximum number of scans per location. Returns list of alert entries in
scans
field. Each entry has country
, city
, scans
(number of
scans in that location), user
(user who made the scans). Entries are
ordered by the number of scans in the scans
field.
POST /analytic-service/alerts/get_scans_per_location
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
country |
string | Filter alert entries by country |
city |
string | Filter alert entries by city |
limit |
1.. | Limit number of returned alert entries |
Example Request
{
"from_date": "2017-10-01",
"country": "036",
"limit": 5
}
Example Response
{
"scans": [
{
"city": "Melbourne",
"country": "036",
"scans": 37,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"city": "Melbourne",
"country": "036",
"scans": 3,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
},
{
"city": "Brighton",
"country": "036",
"scans": 1,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
},
{
"city": null,
"country": "036",
"scans": 1,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
},
{
"city": "Point Cook",
"country": "036",
"scans": 1,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
}
]
}
Scans in Separated Locations
Pair of scans in separated locations in one day. Returns list of alert
entries in separated_locations
field. Each entry has scan1
(least
recent scan in pair of separated scans), scan2
(most recent scan in
pair of separated scans) and user
(info on user who made these
scans) fields. Scan objects in scan1
and scan2
fields have id
(scan identifier), ts
(date and time of the scan), city
, country
fields. Entries are ordered by scan timestamps from most recent to
least recent.
Location filtering parameters country
and city
are not applicable
to this API.
POST /analytic-service/alerts/get_separated_locations
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
limit |
1.. | Limit number of returned alert entries |
Example Request
{
"from_date": "2017-10-01",
"limit": 5
}
Example Response
{
"separated_locations": [
{
"scan1": {
"city": "Melbourne",
"country": "036",
"id": "8f8a77a0-f0b0-4b5e-bebd-b26eab9203a1",
"ts": "2017-10-06T01:03:39Z"
},
"scan2": {
"city": "Point Cook",
"country": "036",
"id": "17215e0b-255f-4926-8627-5e0fee01f648",
"ts": "2017-10-06T08:26:56Z"
},
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"scan1": {
"city": "Melbourne",
"country": "036",
"id": "29297529-8267-4acb-aa40-58c15eb8baaa",
"ts": "2017-10-04T08:24:30Z"
},
"scan2": {
"city": "Brighton",
"country": "036",
"id": "75272506-6e7c-4eb3-96b2-b5b7212d55e1",
"ts": "2017-10-04T10:29:09Z"
},
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
},
{
"scan1": {
"city": "Melbourne",
"country": "036",
"id": "eb805398-102d-40e0-b7b6-ce4ce54be2d2",
"ts": "2017-10-04T08:24:49Z"
},
"scan2": {
"city": "Brighton",
"country": "036",
"id": "75272506-6e7c-4eb3-96b2-b5b7212d55e1",
"ts": "2017-10-04T10:29:09Z"
},
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
}
]
}
Scan Time Difference
Time between consecutive scans by a user. Returns list of alert
entries in time_diffs
field. Each entry has scan1
(least recent
scan in the pair of scans), scan2
(most recent scan in the pair of
scans), time_diff
(difference between time of scan1
and scan2
in
seconds) and user
(info on user who made these scans) fields. Scan
objects in scan1
and scan2
fields have id
(scan identifier) and
ts
(date and time of the scan) fields. Entries are ordered by scan
time difference in time_diff
field from small to large.
POST /analytic-service/alerts/get_scan_time_diff
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
country |
string | Filter alert entries by country |
city |
string | Filter alert entries by city |
limit |
1.. | Limit number of returned alert entries |
Example Request
{
"from_date": "2017-10-01",
"country": "036",
"limit": 5
}
Example Response
{
"time_diffs": [
{
"scan1": {
"id": "4479a566-c251-4c56-881f-12888bac6872",
"ts": "2017-10-04T06:39:39Z"
},
"scan2": {
"id": "fad95807-3c01-4b04-b8c3-4f227f6109c1",
"ts": "2017-10-04T06:39:42Z"
},
"time_diff": 3,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"scan1": {
"id": "08f775bb-4e3a-4316-99a9-7fcb54f4302b",
"ts": "2017-10-04T06:39:10Z"
},
"scan2": {
"id": "d475fa81-18cc-41d0-bfe2-358452e1639c",
"ts": "2017-10-04T06:39:14Z"
},
"time_diff": 4,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": null,
"first_name": "Jane",
"gender": null,
"id": "urn:authenticateit:user:facebook:12345678901234567",
"language": null,
"last_name": "Doe",
"level": "basic"
}
}
]
}
Reward Coins per Day
Number of reward coins earned per day by a user. Returns list of
alert entries in coins
field. Each entry has date
, coins
(number of reward coins earned on that day), user
(info on user who
earned the coins) fields. Entries are ordered by the number of coins
in coins
field, from bigger to smaller number of coins.
POST /analytic-service/alerts/get_coins_per_day
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
country |
string | Filter alert entries by country |
city |
string | Filter alert entries by city |
limit |
1.. | Limit number of returned alert entries |
Example Request
{
"from_date": "2017-10-01",
"country": "036",
"limit": 5
}
Example Response
{
"coins": [
{
"date": "2017-10-04",
"coins": "7890000000",
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-05",
"coins": 700000000,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
},
{
"date": "2017-10-06",
"coins": 220000000,
"user": {
"birthdate": null,
"city": null,
"country": "036",
"email": "j.d@gmail.com",
"first_name": "Jonh",
"gender": null,
"id": "urn:authenticateit:user:email:j.d@gmail.com",
"language": "en",
"last_name": "Doe",
"level": "basic"
}
}
]
}
Coin Transfers per Day
Reward coins transferred per day by a user. Returns list of alert
entries in coins
field. Each entry has date
, coins
(number of
coins transferred on that day), user
(user who transferred the
coins) fields. Entries are ordered by the number of coins in coins
field.
POST /analytic-service/alerts/get_transfers_per_day
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
from_date |
string | Filter alert entries by date range |
to_date |
string | Filter alert entries by date range |
limit |
1..100 | Limit number of returned alert entries |
Example Request
{
"from_date": "2018-03-01",
"limit": 5
}
Example Response
{
"coins": [
{
"coins": "5000000000000000000000",
"date": "2018-03-16",
"user": {
"birthdate": "1979-01-01",
"city": "Izhevsk",
"email": "xyz@example.com",
"first_name": "user",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@example.com",
"language": "en",
"last_name": "かんじ",
"level": "silver"
}
},
{
"coins": "1500000000000000000000",
"date": "2018-03-18",
"user": {
"birthdate": "1979-01-01",
"city": "Izhevsk",
"email": "xyz@example.com",
"first_name": "user",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@example.com",
"language": "en",
"last_name": "かんじ",
"level": "silver"
}
},
{
"coins": "1000000000000000000000",
"date": "2018-03-23",
"user": {
"birthdate": "1979-01-01",
"city": "Izhevsk",
"email": "xyz@example.com",
"first_name": "user",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@example.com",
"language": "en",
"last_name": "かんじ",
"level": "silver"
}
},
{
"coins": "1000000000000000000000",
"date": "2018-03-22",
"user": {
"birthdate": "1979-01-01",
"city": "Izhevsk",
"email": "xyz@example.com",
"first_name": "user",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@example.com",
"language": "en",
"last_name": "かんじ",
"level": "silver"
}
},
{
"coins": "1000000000000000000000",
"date": "2018-03-21",
"user": {
"birthdate": "1979-01-01",
"city": "Izhevsk",
"email": "xyz@example.com",
"first_name": "user",
"gender": "male",
"id": "urn:authenticateit:user:email:xyz@example.com",
"language": "en",
"last_name": "かんじ",
"level": "silver"
}
}
],
"from_date": "2018-03-01",
"limit": 5,
"to_date": "2018-07-10"
}
Email Alerts
Email alert methods require report_viewer
role from the system
participant.
Get Configuration
Current system analytics email alerts configuration. Returns JSON
object containing fields email
(list of alert recepient emails),
coins_per_hour
(threshold for reward coins per hour),
rewards_per_hour
(threshold for reward redemptions per hour),
scans_per_hour
(threshold for the number of scans per hour) and
user_scans_per_hour
(threshold for the number of scans per hour per
user). Any threshold may be null
if there is no threshold set for
the metric.
GET /analytic-service/alerts/email
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
Example Response
{
"email": ["j.d@gmail.com", "xyz@foo.br"],
"coins_per_hour": "10000000000000",
"rewards_per_hour": 50,
"scans_per_hour": null,
"user_scans_per_hour": 50
}
Set Configuration
Update current system analytics email alerts configuration. Accepts
JSON object which may contain fields email
(possibly empty list of
emails), coins_per_hour
(threshold for the number of reward coins
per hour), rewards_per_hour
(threshold for the number of reward
redemptions per hour), scans_per_hour
(threshold for the number of
scans per hour) and user_scans_per_hour
(threshold for the number of
scans per hour per user). Any threshold may be disabled by setting it
to null
. If the measured value becomes greater than the
corresponding threshold, email will be sent to the addresses from the
email
field.
Response contains current configuration after the update.
PUT /analytic-service/alerts/email
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Session's ticket (required) |
Example Request
{
"email": ["j.d@gmail.com"],
"coins_per_hour": null,
"scans_per_hour": 5000
}
Example Response
{
"email": ["j.d@gmail.com"],
"coins_per_hour": null,
"rewards_per_hour": 50,
"scans_per_hour": 5000,
"user_scans_per_hour": 50
}
ToDo card counts
Counters related to ToDo cards. The result is a JSON object with
fields num_recipients
(number of users who received ToDo cards),
num_dismissed
(number of dismissed ToDo cards) and num_completed
(number of ToDo cards completed by users).
Parameters from_date
and to_date
may be used to count only cards,
delivered in the time interval.
Parameter card_id
may be used to restrict returned counters by
specific ToDo card.
To access this endpoint user must have todo_cards_supervisor
role
from participant.
POST /analytic-service/todo_cards/get_counts
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket |
header | Required: Session's ticket |
from_date |
string | Count cards after the date |
to_date |
string | Count cards before the date |
card_id |
string | Return counters for specific card |
Example Request
{
"from_date": "2017-01-01",
"to_date": "2018-01-01"
}
Example Response
{
"from_date": "2017-01-01",
"to_date": "2018-01-01",
"num_completed": 18,
"num_dismissed": 192,
"num_recipients": 1482
}
Average Retention Rate
Methods are available only for system
Create ARR task
The method returns task ID and task parameters.
POST /analytic-service/users/arr/task
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
countries | list | Optional list of countries |
from_datetime | string | Required: Strart datetime |
to_datetime | string | Required: End datetime |
timezone_min | integer | User's timezone offset in minutes |
type | string | Required: Type of initial data - scan_based or creation_date_based |
Example Request
{
"from_datetime":"2018-01-01T00:00:00Z",
"to_datetime":"2019-01-01T00:00:00Z",
"type": "scan_based",
"countries": [
"643"
]
}
Example Response
{
"countries": [
"643"
],
"from_datetime": "2018-01-01T00:00:00Z",
"id": "arr_b87c4578-20c5-4880-b765-7945c1e76d2c",
"started": "2019-02-24T22:43:36Z",
"status": "in_progress",
"to_datetime": "2019-01-01T00:00:00Z",
"type": "scan_based"
}
Read tasks
The method return tasks ids with parameters and statuses. Possible statuses: in_progress
, failure
, success
.
GET /analytic-service/users/arr/task
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
Example Response
[
{
"countries": [
"643"
],
"from_datetime": "2018-01-01T00:00:00Z",
"id": "arr_b87c4578-20c5-4880-b765-7945c1e76d2c",
"started": "2019-02-24T22:43:36Z",
"status": "success",
"to_datetime": "2019-01-01T00:00:00Z",
"type": "scan_based"
},
{
"countries": [
"643"
],
"from_datetime": "2018-01-01T00:00:00Z",
"id": "arr_f9e840cc-11b2-418d-b9bd-68ab70af2fdc",
"started": "2019-02-24T22:43:17Z",
"status": "success",
"to_datetime": "2019-01-01T00:00:00Z",
"type": "creation_date_based"
}
]
Delete task
DELETE /analytic-service/users/arr/task/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | Required: Task ID |
Get ARR task data
GET /analytic-service/users/arr/task/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | Required: Task ID |
Example Response
[
{
"0": 10,
"30": 2,
"60": 0,
"90": 5,
"group": "2018-01",
"users_total": 17
},
{
"0": 9,
"30": 0,
"60": 0,
"90": 1,
"group": "2018-02",
"users_total": 10
},
{
"0": 15,
"30": 1,
"60": 0,
"90": 2,
"group": "2018-03",
"users_total": 18
},
{
"0": 10,
"30": 0,
"60": 0,
"90": 2,
"group": "2018-04",
"users_total": 12
},
{
"0": 26,
"30": 0,
"60": 0,
"90": 4,
"group": "2018-05",
"users_total": 30
},
{
"0": 7,
"30": 3,
"60": 1,
"90": 1,
"group": "2018-06",
"users_total": 12
},
{
"0": 6,
"30": 1,
"60": 0,
"90": 0,
"group": "2018-07",
"users_total": 7
},
{
"0": 15,
"30": 6,
"60": 2,
"90": 1,
"group": "2018-08",
"users_total": 24
},
{
"0": 3,
"30": 0,
"60": 0,
"90": 1,
"group": "2018-09",
"users_total": 4
},
{
"0": 8,
"30": 0,
"60": 1,
"90": 4,
"group": "2018-10",
"users_total": 13
},
{
"0": 7,
"30": 2,
"60": 2,
"90": 0,
"group": "2018-11",
"users_total": 11
},
{
"0": 5,
"30": 2,
"60": 0,
"90": 0,
"group": "2018-12",
"users_total": 7
}
]
Get ARR users
POST /analytic-service/users/arr/task/users/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | Required: Task ID |
group | string | Required: Group name |
element | string | Required: 0, 30, 60 or 90 |
limit | integer | Non negative integer |
offset | string | Non negative integer |
Example Request
{
"group": "2018-10",
"element": "90",
"limit": 2,
"offset":0
}
Example Response
{
"count": 4,
"data": [
{
"country": "643",
"email": "1710@mailinator.com",
"first_name": "Света",
"id": "urn:authenticateit:user:email:1710@mailinator.com",
"language": "en",
"last_name": "Морозова"
},
{
"country": "643",
"email": "19101@mailinator.com",
"first_name": "Gregory",
"id": "urn:authenticateit:user:email:19101@mailinator.com",
"language": "en",
"level": "basic"
}
]
}
Summary reports
Methods are available for any participants. The system can request a report for self and for any participants. System report requires limitation by dates and can be built max for 30 days interval.
Create Summary report task
POST /analytic-service/summary/task/
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
countries | list | Optional list of countries |
from_datetime | string | Strart datetime |
to_datetime | string | End datetime |
users_blacklist | list | Optional list of ignored users |
products | list | Optional list of products |
Example Request
{
"from_datetime": "2018-02-20T23:17:02Z",
"countries": [
"643",
"036"
],
"to_datetime": "2019-03-20T23:17:02Z",
"users_blacklist": [
"urn:authenticateit:user:email:foo@bar.com"
],
"products": [
"00498765432998"
]
}
Example Response
{
"filters": {
"countries": [
"643",
"036"
],
"from_datetime": "2018-02-20T23:17:02Z",
"products": [
"00498765432998"
],
"to_datetime": "2019-03-20T23:17:02Z",
"users_blacklist": [
"urn:authenticateit:user:email:mail@gmail.com"
]
},
"id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
"report_by": {
"id": "urn:authenticateit:participant:735879621218609",
"name": "Participant Name"
},
"started": "2019-03-01T00:16:21Z",
"status": "in_progress"
}
Read Summary report tasks
The method return tasks ids with parameters and statuses. Possible statuses: in_progress
, failure
, success
.
GET /analytic-service/summary/task/
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
Example Response
[
{
"filters": {
"countries": [
"643",
"036"
],
"from_datetime": "2018-02-20T23:17:02Z",
"products": [
"00498765432998"
],
"to_datetime": "2019-03-20T23:17:02Z",
"users_blacklist": [
"urn:authenticateit:user:email:foo@bar.com"
]
},
"id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
"report_by": {
"id": "urn:authenticateit:participant:735879621218609",
"name": "Participant Name"
},
"started": "2019-03-01T00:16:21Z",
"status": "success"
}
]
Delete Summary report task
DELETE /analytic-service/summary/task/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | Required: Task ID |
Get Summary report task data
Data available only when the status of the task is success
GET /analytic-service/summary/task/:id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
id | string | Required: Task ID |
Example Response
{
"campaigns": {
"urn:authenticateit:campaign:646619739765882": {
"counter": 6,
"name": "Campaign name 1"
},
"urn:authenticateit:campaign:983294512189939": {
"counter": 2,
"name": "Campaign name 2"
}
},
"cities": {
"unknown": 55
},
"countries": [
{
"count": 54,
"country": "036",
"registered_count": 54
},
{
"count": 33,
"country": "643",
"registered_count": 33
}
],
"reviews": {
"total_approved_reviews": 5,
"total_reviews": 5,
"total_unique_users_who_made_review": 5
},
"scans": {
"total_authorised_scans": 87,
"total_scans": 87,
"total_unique_users_who_made_scan": 16
},
"task": {
"filters": {
"countries": [
"643",
"036"
],
"from_datetime": "2018-02-20T23:17:02Z",
"products": [
"00498765432998"
],
"to_datetime": "2019-03-20T23:17:02Z",
"users_blacklist": [
"urn:authenticateit:user:email:foo@bar.com"
]
},
"id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
"report_by": {
"id": "urn:authenticateit:participant:735879621218609",
"name": "Participant Name"
},
"started": "2019-03-01T00:16:21Z"
},
"widgets": {
"links": {
"http://www.foo1.bar": 1,
"http://www.foo2.bar": 1,
"http://www.foo3.bar": 1,
"total_links": 3
},
"image": {
"total_images": 1005
},
"social_networks": {
"http://google.com": 10,
"http://www.skinb5.com/en/": 4,
"https://www.facebook.com/SkinB5/": 7,
"https://www.instagram.com/skinb5/": 4,
"https://www.youtube.com/channel/UCOfHAvY4wqKgAyOuSA4ao2Q": 8,
"total_social_networks": 33
},
"video": {
"https://cdn.shping.com/2018/7/8/710c1e22-eac4-405b-8e7b-c0e8fc30439c.mp4": 2,
"https://cdn.shping.com/2018/7/8/aa4c6e66-95a4-4cde-ad3e-0b324a581fab.mp4": 6,
"https://cdn.shping.com/2018/8/2/aa3b6724-4635-4a31-8cec-96488b9f1690.mp4": 51,
"total_video": 59,
"video_subdata": {
"https://cdn.shping.com/2018/7/8/710c1e22-eac4-405b-8e7b-c0e8fc30439c.mp4": "Video Name 1",
"https://cdn.shping.com/2018/7/8/aa4c6e66-95a4-4cde-ad3e-0b324a581fab.mp4": "Video Name 2",
"https://cdn.shping.com/2018/8/2/aa3b6724-4635-4a31-8cec-96488b9f1690.mp4": "Video Name 3"
}
}
}
}
Access Trail
Add Access Trail Event
POST /audit-trail/event
Parameters
Name | Type | Description |
---|---|---|
request_ts | string | Required: Unix ts. Not null |
source | string | Required: Source. Not null. Max length 255 |
client_id | string | Client id. Nullable. Max length 255 |
service | string | Service. Nullable. Max length 255 |
url | string | Url. Nullable. Text |
method | string | Method. Nullable. Max length 32 |
remote_ip | string | Remote ip. Nullable. Max length 255 |
req_content_type | string | Request content type. Nullable. Max length 255 |
req_content_length | string | Request content length. Nullable. Integer |
req_body | string | Request content body. Nullable. Text |
res_content_type | string | Response content type. Nullable. Max length 255 |
res_content_length | string | Response content length. Nullable. Integer |
res_body | string | Response content body. Nullable. Text |
authenticateit_identity_ticket | string | Session's ticket. Nullable. Max length 255 |
tsl_version | string | Tsl version. Nullable. Max length 255 |
refer | string | Refer. Nullable. Text |
response_time | string | Response time. Nullable. Numeric |
Example Request
{
"request_ts": "1670369276",
"client_id": "client_id",
"source": "source",
"service": "service",
"url": "http://127.0.0.1",
"method": "GET",
"remote_ip": "127.0.0.1",
"req_content_type": "application/json",
"req_content_length": "1",
"req_body": "1",
"res_content_type": "application/json",
"res_content_length": "1",
"res_body": "1",
"authenticateit_identity_ticket": "ticket",
"tsl_version": "tsl1.1",
"refer": null,
"response_time": "0.01"
}
Example Response
{
"id": "a0e7ed59-786c-4793-b246-bb8ee74de881"
}
Read Access Trail Events
Available only for users with role accesstrail_admin
POST /analytic-service/audit-trail/events/get
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
limit | integer | Limit (10 by default. Maximum is 100) |
source | string | Source filter (maxlen is 255) |
user_id | string | UserId filter (maxlen is 255) |
participant_id | string | ParticipantId filter (maxlen is 255) |
Example Request
{
"limit": 2,
"offset": 40,
"source": "nginx"
}
Example Response
{
"count": 51,
"data": [
{
"client_id": null,
"id": "41",
"method": "GET",
"participant_id": null,
"refer": null,
"remote_ip": "122.104.120.126",
"req_body": null,
"req_content_length": null,
"req_content_type": "application/json",
"request_id": "5e36796c-c8be-449e-9ce3-9d409b639a5d",
"request_ts": "2022-12-08 02:10:53",
"res_body": "{\"manual_actions\":[{\"id\":\"manual_duplicate_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Duplicate receipt upload\"},{\"id\":\"manual_receipt_sharing\",\"karma_value_action\":\"dec\",\"name\":\"Receipt sharing\"},{\"id\":\"manual_fake_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Fake receipt upload\"},{\"id\":\"manual_fake_buddies_behaviour\",\"karma_value_action\":\"dec\",\"name\":\"Fake buddies behaviour\"}]}",
"res_content_length": "396",
"res_content_type": "application/json",
"response_time": "0.00500000",
"service": "settings-service",
"source": "nginx",
"ticket": null,
"tsl_version": null,
"url": "https://dev-api.shping.com/settings-service/karma/manual_actions",
"user_id": null
},
{
"client_id": null,
"id": "42",
"method": "GET",
"participant_id": "urn:authenticateit:participant:1",
"refer": null,
"remote_ip": "122.104.120.126",
"req_body": null,
"req_content_length": null,
"req_content_type": "application/json",
"request_id": "ccd041b0-7f88-4e48-bd28-1eaec977c6e9",
"request_ts": "2022-12-08 02:11:15",
"res_body": "{\"manual_actions\":[{\"id\":\"manual_duplicate_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Duplicate receipt upload\"},{\"id\":\"manual_receipt_sharing\",\"karma_value_action\":\"dec\",\"name\":\"Receipt sharing\"},{\"id\":\"manual_fake_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Fake receipt upload\"},{\"id\":\"manual_fake_buddies_behaviour\",\"karma_value_action\":\"dec\",\"name\":\"Fake buddies behaviour\"}]}",
"res_content_length": "396",
"res_content_type": "application/json",
"response_time": "0.00500000",
"service": "settings-service",
"source": "nginx",
"ticket": "48d52dae-4d96-4714-93df-276d60b85209",
"tsl_version": null,
"url": "https://dev-api.shping.com/settings-service/karma/manual_actions",
"user_id": "urn:authenticateit:user:email:system@authenticateit.com"
}
]
}
Read Access Trail Event by RequestId
Available only for users with role accesstrail_admin
GET /analytic-service/audit-trail/event/:request_id
Parameters
Name | Type | Description |
---|---|---|
authenticateit_identity_ticket | header | Required: Session's ticket |
request_id | string | Required: Request id |
Example Response
{
"connection": "close, TE",
"content-type": "application/json",
"host": "analytic:8019",
"internal_request_id": "ccd041b0-7f88-4e48-bd28-1eaec977c6e9",
"method": "GET",
"remote_ip": "122.104.120.126",
"req_content_type": "application/json",
"request_ts": "2022-12-08T02:11:15Z",
"res_body": "{\"manual_actions\":[{\"id\":\"manual_duplicate_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Duplicate receipt upload\"},{\"id\":\"manual_receipt_sharing\",\"karma_value_action\":\"dec\",\"name\":\"Receipt sharing\"},{\"id\":\"manual_fake_receipt_upload\",\"karma_value_action\":\"dec\",\"name\":\"Fake receipt upload\"},{\"id\":\"manual_fake_buddies_behaviour\",\"karma_value_action\":\"dec\",\"name\":\"Fake buddies behaviour\"}]}",
"res_content_length": 396,
"res_content_type": "application/json",
"response_time": 0.005,
"service": "settings-service",
"session_participant": "urn:authenticateit:participant:1",
"session_user": "urn:authenticateit:user:email:system@authenticateit.com",
"source": "nginx",
"status": "200",
"te": "trailers",
"transfer-encoding": "chunked",
"url": "https://dev-api.shping.com/settings-service/karma/manual_actions",
"user-agent": "LuaSocket 3.0.0"
}