Acquisition
Acquisition related endpoints
Returns acquisition predictions for the given date
.
You can specify a single user to get predictions for by setting the user
field or get predictions for all users. Notice that in the latter case the results will be paginated so you will need to query the endpoint multiple times in order to get the predictions for all users.
Specify product
Notice that you must specify the product
query parameter in order to get retention predictions for a specific product. For example if both sports
and casino
retention predictions are generated you must set to the product
, field one of sports
, casino
or combined
.
If not set it defaults to sports
.
This delegates to /api/crm/predictions/acquisition
.
Returned values
The acquisition models predict the Gross Gaming Revenue (GGR) of a user for the first 30, 60, 90 and 180 days after the first active day.
The predictive fields are the following:
{
"predicted_ev_first_030": 4.9,
"predicted_ev_first_060": 7.3,
"predicted_ev_first_090": 13.6,
"predicted_ev_first_180": 24.2,
"predicted_ev_first_365": 45.9,
"predicted_ggr_first_030": 0.8,
"predicted_ggr_first_060": 1.24,
"predicted_ggr_first_090": 2.1,
"predicted_ggr_first_180": 4.12,
"predicted_ggr_first_365": 7.9,
}
The user to get information for.
The date to get predictions for. Can be latest
for latest available data.
If not set, defaults to the current date.
now
The operator to use for querying data. Notice that this is applied only if your account has access to multiple operators. In a different case the assigned operator to your account is used and the value of this field is ignored.
The bookmaker id to use for querying data. Notice that this is applied only
if your account has access to multiple operators. In a different case
the assigned operator to your account is used and the value of this
field is ignored. Note that this parameter is used together with the
sub_bookmaker_id
parameter.
The sub-bookmaker id to use for querying data. Notice that this is applied only
if your account has access to multiple operators. In a different case
the assigned operator to your account is used and the value of this
field is ignored. Note that this parameter is used together with the
bookmaker_id
parameter.
The type of product to get predictions for. If an operator has the CRM
package for more than one products, then this must be set. Can be one
of sports, casino, horses, combined. If not set it defaults to sports
.
sports
Possible values: The columns to sort the results by. It expects a string adhering to
the ordering format, as described in the ordering section, e.g.
+predicted_ggr_first_030,-predicted_ggr_first_060
.
+user_id
Possible values: Optional filtering of the results. It expects a string adhering to the
filtering format, as described in the filtering section, e.g.
churn_score_007:gt:0.7;predicted_ggr_030:lt:5000
.
""
Possible values: The page to retrieve. Notice that if set the random access pagination mechanism will be used. If not set the pagination mechanism default to the keyset mode.
The number of items ot include in each page.
100
The cursor to get data from. It should be retrieved from the pagination
section of a previous response in case of keyset
pagination.
This value will be ignored if the page
parameter has been provided
and random access pagination will be used instead.
Notice that the the cursor is cryptographically signed and verified, make sure to set the exact value it was returned.
If set then the cache will not be used and the computation of the underlying function will be enforced.
This parameter is for internal use only.
false
The underlying schema version. Some endpoints can operate on multiple
internal database schemas. Must be one of the allowed values. If not
set it defaults to v2
.
v2
Possible values: Custom client header, the value should be the name of the group the user belongs to
Authentication method to be used, supported values [vaix
, iam
]. Defaults to vaix
OK
Bad Request
Unauthorized
Forbidden
Not Acceptable
Request Entity Too Large
Unprocessable Entity
Too Early
Internal Server Error
GET /api/crm/predictions/acquisition HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
"data": [
{
"acquisition_source": "KCWVVSD",
"apds": 6,
"apds_last_30": 5,
"country": "ke",
"currency": "EUR",
"gender": null,
"inactive_days": 2,
"last_active_date": "2021-05-07",
"last_deposit_date": "2021-05-07",
"predicted_ev_first_030": 118.52,
"predicted_ev_first_060": 121.82,
"predicted_ev_first_090": 123.67,
"predicted_ev_first_180": 135.37,
"predicted_ev_first_365": null,
"predicted_ggr_first_030": 1.64,
"predicted_ggr_first_060": 1.72,
"predicted_ggr_first_090": 1.82,
"predicted_ggr_first_180": 1.9,
"predicted_ggr_first_365": null,
"prediction_date": "2021-05-10",
"product": "sports",
"signup_date": "2021-01-11",
"state": null,
"total_ggr": 1.528,
"user_id": "999993"
},
{
"acquisition_source": "KCWVVFX01",
"apds": 34,
"apds_last_30": 1,
"country": "ke",
"currency": null,
"gender": null,
"inactive_days": 0,
"last_active_date": "2021-05-09",
"last_deposit_date": "2021-04-11",
"predicted_ev_first_030": 145.32,
"predicted_ev_first_060": 148.54,
"predicted_ev_first_090": 150.89,
"predicted_ev_first_180": 160.12,
"predicted_ev_first_365": null,
"predicted_ggr_first_030": 38.28,
"predicted_ggr_first_060": 39.41,
"predicted_ggr_first_090": 39.92,
"predicted_ggr_first_180": 43.42,
"predicted_ggr_first_365": null,
"prediction_date": "2021-05-10",
"product": "sports",
"signup_date": "2020-06-12",
"state": null,
"total_ggr": 37.9102,
"user_id": "999964"
},
{
"acquisition_source": "KCWVVFX01",
"apds": 51,
"apds_last_30": 1,
"country": "ke",
"currency": null,
"gender": null,
"inactive_days": 10,
"last_active_date": "2021-04-29",
"last_deposit_date": "2021-04-29",
"predicted_ev_first_030": 92.13,
"predicted_ev_first_060": 95.12,
"predicted_ev_first_090": 98.74,
"predicted_ev_first_180": 105.39,
"predicted_ev_first_365": null,
"predicted_ggr_first_030": 1.2,
"predicted_ggr_first_060": 1.43,
"predicted_ggr_first_090": 1.53,
"predicted_ggr_first_180": 2.07,
"predicted_ggr_first_365": null,
"prediction_date": "2021-05-10",
"product": "sports",
"signup_date": "2020-10-24",
"state": null,
"total_ggr": 1.093,
"user_id": "999781"
},
{
"acquisition_source": "KCWVVFBZ",
"apds": 2,
"apds_last_30": 1,
"country": "ke",
"currency": null,
"gender": null,
"inactive_days": 29,
"last_active_date": "2021-04-10",
"last_deposit_date": "2020-08-29",
"predicted_ev_first_030": 20.01,
"predicted_ev_first_060": 22.35,
"predicted_ev_first_090": 25.02,
"predicted_ev_first_180": 30.12,
"predicted_ev_first_365": null,
"predicted_ggr_first_030": 0.31,
"predicted_ggr_first_060": 0.31,
"predicted_ggr_first_090": 0.31,
"predicted_ggr_first_180": 0.31,
"predicted_ggr_first_365": null,
"prediction_date": "2021-05-10",
"product": "sports",
"signup_date": "2020-08-29",
"state": null,
"total_ggr": 0.3124,
"user_id": "999768"
},
{
"acquisition_source": "KCWVVFX01",
"apds": 6,
"apds_last_30": 2,
"country": "ke",
"currency": null,
"gender": null,
"inactive_days": 15,
"last_active_date": "2021-04-24",
"last_deposit_date": "2021-04-23",
"predicted_ev_first_030": 3.22,
"predicted_ev_first_060": 4.49,
"predicted_ev_first_090": 4.88,
"predicted_ev_first_180": 5.22,
"predicted_ev_first_365": null,
"predicted_ggr_first_030": -0.49,
"predicted_ggr_first_060": -0.49,
"predicted_ggr_first_090": -0.49,
"predicted_ggr_first_180": -0.49,
"predicted_ggr_first_365": null,
"prediction_date": "2021-05-10",
"product": "sports",
"signup_date": "2020-10-03",
"state": null,
"total_ggr": -0.4863,
"user_id": "999756"
}
],
"pagination": {
"page": 1,
"page_count": 25525,
"page_size": 5,
"total_count": 127625
},
"status": "success"
}
This is a generic endpoint for retrieving CRM acquisition related statistics.
You can apply any filtering you want on the CRM data, group them in many ways and apply multiple aggregations on the prediction fields.
Aggregations
By setting the aggregations
parameter you can select the set of aggregations to be applied on the given fields
. The following aggregation operations are supported:
min
: return the minimum valuemax
: return the maximum valueavg
: return the average valuesum
: return the sum
Multiple aggregations
You can apply multiple aggregations at once by providing a comma separated list of aggregation operations. For example if you wanted to get the min
, max
and avg
value of ggr
you could simply call the endpoint with the following parameters:
aggregations=min,max,avg
fields=ggr_first_30
{
"data": [
{
"avg_ggr_first_30": 32.24,
"count": 2881,
"max_ggr": 8837.9103,
"min_ggr": -115770.3471
}
],
"status": "success"
}
Implied count
As you will notice a count is always returned no matter what aggregations or fields you select. If you run the endpoint without any parameters you simply run a count(*)
on the underlying database table.
Grouping results
You can group the results by any supported field or any combination of fields, by using the group_by
parameter. A comma separated list of fields to group by is expected.
Counts by acquisition source
Imagine that you want to get the counts of users, by acquisition source for a specific prediction date. You can simply do it by using the following query parameters:
filters=prediction_date:eq:2021-07-21
group_by=acquisition_source
which would give the following results
{
"data": [
{
"count": 420,
"acquisition_source": "facebook"
},
{
"count": 503,
"acquisition_source": "google_ads"
},
{
"count": 249,
"acquisition_source": "other"
}
...
]
}
Filtering the result set
Similarly to many other endpoints the stats/crm/acquisition
endpoint supports filtering of the result set. By setting the filters
parameter you can apply any combination of filters you may wish.
Average predictions for churn score cohorts
Assume you want to get the average, minimum and maximum GGR predictions for users with predicted ggr value for the first 30 days between 0 and 100 grouped by the acquisition source for a specific prediction date.
You can use the following parameters:
aggregations=min,max,avg
fields=predicted_ggr_first_030,predicted_ggr_first_060
filters=prediction_date:eq:2021-07-15;predicted_ggr_first_030:gte:0;predicted_ggr_first_030:lt:100
group_by=acquisition_source
and you will get results of the form:
{
"data": [
{
"acquisition_source": "defmoney",
"avg_predicted_ggr_first_030": -0.24308623298033255,
"avg_predicted_ggr_first_060": 0.22650529500756464,
"count": 661,
"max_predicted_ggr_first_030": 388.99,
"max_predicted_ggr_first_060": 430.65,
"min_predicted_ggr_first_030": -179.12,
"min_predicted_ggr_first_060": -179.12
},
...
]
}
Avoid empty filters
In most use cases you will need to provide a set of filters in order to limit the result set on which the aggregations will be applied. Notice that if you do not provide any filter the operation will be applied to the complete database table and may cause system performance hiccups, especially if the table is big.
Check your parameters carefully before calling this endpoint. In most cases you will need to add a prediction_date
filter to limit the result set on predictions for a specific date.
The columns to group the results by. It should be a comma separated list
with the columns to use for grouping in the format col1,col2
.
The columns to use in aggregations. It should be a comma separated list,
e.g. predicted_apds_030,predicted_ggr_030
.
The aggregations to be applied on all selected fields. You can pass
more than one aggregations through a comma separated list, e.g.
min,max,avg
.
The type of product to get predictions for. If an operator has the CRM
package for more than one products, then this must be set. Can be one
of sports, casino, horses, combined. If not set it defaults to sports
.
sports
Possible values: Optional filtering of the results. It expects a string adhering to the
filtering format, as described in the filtering section, e.g.
churn_score_007:gt:0.7;predicted_ggr_030:lt:5000
.
""
Possible values: The underlying schema version. Some endpoints can operate on multiple
internal database schemas. Must be one of the allowed values. If not
set it defaults to v2
.
v2
Possible values: Custom client header, the value should be the name of the group the user belongs to
Authentication method to be used, supported values [vaix
, iam
]. Defaults to vaix
OK
Bad Request
Unauthorized
Forbidden
Not Acceptable
Request Entity Too Large
Unprocessable Entity
Too Early
Internal Server Error
GET /api/stats/crm/acquisition HTTP/1.1
Host: api.vaix.ai
Authorization: Bearer YOUR_SECRET_TOKEN
x-vaix-client-id: text
Accept: */*
{
"data": [
{
"count": 127625
}
],
"status": "success"
}
Was this helpful?