Use cases
List highest-grossing games in a country
If a country code that one has interest in is known (GB
in this example), then it's easy to get the top 3 of the game with the highest revenue for 1st of August using the flowing query:
cat <<EOF |
{
"interval": "2020-08-01/P1D",
"granularity": "day",
"filter": {
"country_code": "GB"
},
"query": {
"type": "group",
"dimension": "game_id",
"limit": 5
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/revenue
The result would be comprised of games and revenue for the specified day along with the auxiliary information:
{
"result": [
{
"result": [
{
"event_count": 19,
"game_id": "3959346",
"mean": 14.503157894736843,
"sum": 275.56,
"sum_cents": 27556.0
},
{
"event_count": 9,
"game_id": "3395936",
"mean": 11.847777777777777,
"sum": 106.63,
"sum_cents": 10663.0
},
{
"event_count": 26,
"game_id": "3985343",
"mean": 3.4899999999999998,
"sum": 90.74,
"sum_cents": 9074.0
}
],
"timestamp": "2020-08-01T00:00:00.000Z"
}
]
}
User retention per game split by country
To get the view of the percentage of users who showed up again 7 days after
installing the game use the retention_retro
metric
endpoint:
cat <<EOF |
{
"interval": "2020-08-01/P1D",
"since_days_ago": 7,
"split_by": "country_code"
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/retention_retro
Which would show every game with returning users along with the retention percentage split by the country code as in the example below:
{
"result": [
{
"result": {
"country_code": "ID",
"game_id": "939282",
"retention": 0.07584264855239627
},
"timestamp": "2020-08-01T00:00:00Z"
},
{
"result": {
"country_code": "FR",
"game_id": "939282",
"retention": 0.10570188062186688
},
"timestamp": "2020-08-01T00:00:00Z"
},
// ...
{
"result": {
"country_code": "ID",
"game_id": "23929338",
"retention": 0.2498167752126883
},
"timestamp": "2020-08-01T00:00:00Z"
},
{
"result": {
"country_code": "FR",
"game_id": "23929338",
"retention": 0.05284202444356853
},
"timestamp": "2020-08-01T00:00:00Z"
}
// ...
]
}
Ads
The Ads metrics can provide a view on your players' ad behaviour. This section is intended to help to understand how to request one of the most common performance numbers regarding ads.
At the moment Ads metrics originates from two possible data sources:
- Ad event.
- Impression event (collected from different ad networks such as MoPub and Fyber).
You can read more about integration with Ad event and impression event.
Metrics API provides numerous Ad related metrics including number of impressions & clicks, top Ad placements, top network placements and Ad revenue.
Ad Impressions
This metric shows the number of times Ads were shown in a game over the specified time frame:
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P2D",
"query": {
"dimension": "country_code",
"limit": 3,
"type": "group"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/ad_impressions_count
Which lists the number of shown Ads in a game grouped by country:
{
"result": [
{
"result": [
{
"ad_impressions_count": 520150,
"country_code": "US"
},
{
"ad_impressions_count": 508736,
"country_code": "MX"
},
{
"ad_impressions_count": 448401,
"country_code": "BR"
}
],
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": [
{
"ad_impressions_count": 507126,
"country_code": "US"
},
{
"ad_impressions_count": 501301,
"country_code": "BR"
},
{
"ad_impressions_count": 451321,
"country_code": "MX"
}
],
"timestamp": "2020-12-02T00:00:00.000Z"
}
]
}
Ad type
To get the Ad impression number grouped by ad type one can use the following query:
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P2D",
"query": {
"dimension": "ad_type",
"limit": 3,
"type": "group"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/ad_impressions_count
Which shows the type of the Ads:
{
"result": [
{
"result": [
{
"ad_impressions_count": 3144579,
"ad_type": "interstitial"
},
{
"ad_impressions_count": 558424,
"ad_type": "rewarded_video"
}
],
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": [
{
"ad_impressions_count": 3031312,
"ad_type": "interstitial"
},
{
"ad_impressions_count": 536933,
"ad_type": "rewarded_video"
}
],
"timestamp": "2020-12-02T00:00:00.000Z"
}
]
}
The Ads of types video
, playable
, offer_wall
or banner
could also be seen here if the game has integration with these Ad types as well.
Ad action
To get a breakdown of the action types based on data from the ads events the query can be configured to group the result by ad_action
dimension as follows:
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P2D",
"filter":{
"and": [
{"category": "ads"}
]
},
"query": {
"dimension": "ad_action",
"limit": 5,
"type": "group"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/event_count
The response should be able to tell the total number of ads shown and clicked in the provided date range with a specified granularity:
{
"result": [
{
"result": [
{
"ad_action": "failed_show",
"event_count": 232958376
},
{
"ad_action": "request",
"event_count": 5341350
},
{
"ad_action": "show",
"event_count": 3703003
},
{
"ad_action": "clicked",
"event_count": 1668764
}
],
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": [
{
"ad_action": "failed_show",
"event_count": 227230279
},
{
"ad_action": "request",
"event_count": 5144202
},
{
"ad_action": "show",
"event_count": 3568245
},
{
"ad_action": "clicked",
"event_count": 1690330
}
],
"timestamp": "2020-12-02T00:00:00.000Z"
}
]
}
Ad network impressions (MoPub, Fyber)
Metrics of such type would be able to show the number of times Ads were shown in games via ad network (e.g. MoPub or Fyber) as well as the revenue from the ads over a provided period of time.
timeseries
query can be used to get the number of times the Ads were shown for the provided period:
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P3D",
"query": {
"limit": 10,
"type": "timeseries"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/ilrd_id_unique
The example above returns a number of unique impressions that is grouped by time with a granularity of a day:
{
"result": [
{
"result": {
"ilrd_id_unique": 54071
},
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": {
"ilrd_id_unique": 47965
},
"timestamp": "2020-12-02T00:00:00.000Z"
},
{
"result": {
"ilrd_id_unique": 45325
},
"timestamp": "2020-12-03T00:00:00.000Z"
}
]
}
Top network placements
To get the top network placements based on impressions events from ad networks the impressions could be grouped accordingly as follows:
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P2D",
"query": {
"dimension": "ilrd_network_name",
"limit": 3,
"type": "group"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/ilrd_id_unique
The result will be split with day granularity and show top network names by number of impressions:
{
"result": [
{
"result": [
{
"ilrd_id_unique": 17044,
"ilrd_network_name": null
},
{
"ilrd_id_unique": 11668,
"ilrd_network_name": "admob_native"
},
{
"ilrd_id_unique": 8239,
"ilrd_network_name": "applovin_sdk"
}
],
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": [
{
"ilrd_id_unique": 16699,
"ilrd_network_name": null
},
{
"ilrd_id_unique": 10669,
"ilrd_network_name": "admob_native"
},
{
"ilrd_id_unique": 7684,
"ilrd_network_name": "vungle"
}
],
"timestamp": "2020-12-02T00:00:00.000Z"
}
]
}
Top ad units for revenue
This query could help to find the most popular ad units based on revenue data from ad networks.
cat <<EOF |
{
"granularity": "day",
"interval": "2020-12-01/P2D",
"query": {
"dimension": "ilrd_network_name",
"limit": 3,
"type": "group"
}
}
EOF
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-API-Key: <API KEY>" \
--data-binary @- \
https://metrics.gameanalytics.com/metrics/v1/metrics/ilrd_revenue
The result contains the count of impressions for each of these ad unit as well as the amount of revenue attributed to each of them:
{
"result": [
{
"result": [
{
"event_count": 418422,
"ilrd_adunit_name": "Interstitial",
"mean": 0.00015009160345297347,
"sum": 6280.162890000007,
"sum_cents": 628016.2890000007
},
{
"event_count": 62060,
"ilrd_adunit_name": "Rewarded",
"mean": 0.00033676365613922023,
"sum": 2089.9552500000004,
"sum_cents": 208995.52500000002
},
{
"event_count": 939375,
"ilrd_adunit_name": "Banner",
"mean": 6.934801517658019e-6,
"sum": 651.4379175650001,
"sum_cents": 65143.79175650001
}
],
"timestamp": "2020-12-01T00:00:00.000Z"
},
{
"result": [
{
"event_count": 391713,
"ilrd_adunit_name": "Interstitial",
"mean": 0.0001528559424885057,
"sum": 5987.565980000003,
"sum_cents": 598756.5980000003
},
{
"event_count": 55280,
"ilrd_adunit_name": "Rewarded",
"mean": 0.0003798841298842256,
"sum": 2099.9994699999993,
"sum_cents": 209999.94699999993
},
{
"event_count": 849544,
"ilrd_adunit_name": "Banner",
"mean": 7.448732017705969e-6,
"sum": 632.802559325,
"sum_cents": 63280.25593249999
}
],
"timestamp": "2020-12-02T00:00:00.000Z"
}
]
}