The retention analysis lets you analyse, over time, the number of unique visitors who visited your website or application, and after what period of time they later returned.
This parameter may contain up to 3 variables:
- p: indicates granularity, with:
- Day (p:D): 7 maximum
- Week (p:W): 4 maximum
- Month (p:M): 4 maximum
- nb: indicates the number of rows included in your matrix. The number needs to be inserted with a “-‘ before.
- v: indicates the expected data format. This is optional. By default, the value is in ratio format (v:ratio). You may also obtain percentages (v:percent) or exact values (v:values).
In case of heavy traffic volumes, and with a view to reduce request execution time, you must use our sampling feature if your reference period contains more than 600,000 visitors.
By adding “&samp=auto”, we’ll establish the level of sampling to apply based on a performance indicator:
- 1 in 10 visitors
- 1 in 100 visitors
- 1 in 1000 visitors
If the sampling feature is not used when the reference period contains more than 600,000 visitors, you will receive an API error.
Information about the sampling rate applied to the request is indicated in the call header for JSON & XML formats.
The “columns” parameter is not compatible with the “retention” parameter.
The retention granularity (day, week, month) should correspond to the granularity requested in the “period” parameter.
The reference period for your retention analysis must be a period that has already been completed.
The retention analysis can be done either on your unique visitors, or on your identified visitors (those who have logged in to your site).
By default, if nothing is specified in the API call, unique visitors will be analysed (“&segment=seg_at_uv_id“).
To perform a retention analysis on identified visitors, you must add “&segment=seg_at_visitor_id” to the API call: