ערוך

שתף באמצעות


Get add-on acquisitions

Use this method in the Microsoft Store analytics API to get aggregate acquisition data for add-ons for your app in JSON format during a given date range and other optional filters. This information is also available in the Add-on acquisitions report in Partner Center.

Prerequisites

To use this method, you need to first do the following:

  • If you have not done so already, complete all the prerequisites for the Microsoft Store analytics API.
  • Obtain an Azure AD access token to use in the request header for this method. After you obtain an access token, you have 60 minutes to use it before it expires. After the token expires, you can obtain a new one.

Request

Request syntax

Method Request URI
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/inappacquisitions

Request header

Header Type Description
Authorization string Required. The Azure AD access token in the form Bearer <token>.

Request parameters

The applicationId or inAppProductId parameter is required. To retrieve acquisition data for all add-ons registered to the app, specify the applicationId parameter. To retrieve acquisition data for a single add-on, specify the inAppProductId parameter. If you specify both, the applicationId parameter is ignored.

Parameter Type Description Required
applicationId string The Store ID of the app for which you want to retrieve add-on acquisition data. Yes
inAppProductId string The Store ID of the add-on for which you want to retrieve acquisition data. Yes
startDate date The start date in the date range of add-on acquisition data to retrieve. The default is the current date. No
endDate date The end date in the date range of add-on acquisition data to retrieve. The default is the current date. No
top int The number of rows of data to return in the request. The maximum value and the default value if not specified is 10000. If there are more rows in the query, the response body includes a next link that you can use to request the next page of data. No
skip int The number of rows to skip in the query. Use this parameter to page through large data sets. For example, top=10000 and skip=0 retrieves the first 10000 rows of data, top=10000 and skip=10000 retrieves the next 10000 rows of data, and so on. No
filter string One or more statements that filter the rows in the response. For more information, see the filter fields section below. No
aggregationLevel string Specifies the time range for which to retrieve aggregate data. Can be one of the following strings: day, week, or month. If unspecified, the default is day. No
orderby string A statement that orders the result data values for each add-on acquisition. The syntax is orderby=field [order],field [order],.... The field parameter can be one of the following strings:
  • date
  • acquisitionType
  • ageGroup
  • storeClient
  • gender
  • market
  • osVersion
  • deviceType
  • orderName

The order parameter is optional, and can be asc or desc to specify ascending or descending order for each field. The default is asc.

Here is an example orderby string: orderby=date,market

No
groupby string A statement that applies data aggregation only to the specified fields. You can specify the following fields:
  • date
  • applicationName
  • inAppProductName
  • acquisitionType
  • ageGroup
  • storeClient
  • gender
  • market
  • osVersion
  • deviceType
  • orderName

The returned data rows will contain the fields specified in the groupby parameter as well as the following:

  • date
  • applicationId
  • inAppProductId
  • acquisitionQuantity

The groupby parameter can be used with the aggregationLevel parameter. For example: &groupby=ageGroup,market&aggregationLevel=week

No

Filter fields

The filter parameter of the request contains one or more statements that filter the rows in the response. Each statement contains a field and value that are associated with the eq or ne operators, and statements can be combined using and or or. Here are some example filter parameters:

  • filter=market eq 'US' and gender eq 'm'
  • filter=(market ne 'US') and (gender ne 'Unknown') and (gender ne 'm') and (market ne 'NO') and (ageGroup ne 'greater than 55' or ageGroup ne ‘less than 13’)

For a list of the supported fields, see the following table. String values must be surrounded by single quotes in the filter parameter.

Fields Description
acquisitionType One of the following strings:
  • free
  • trial
  • paid
  • promotional code
  • iap
ageGroup One of the following strings:
  • less than 13
  • 13-17
  • 18-24
  • 25-34
  • 35-44
  • 44-55
  • greater than 55
  • Unknown
storeClient One of the following strings:
  • Windows Phone Store (client)
  • Microsoft Store (client)
  • Microsoft Store (web)
  • Volume purchase by organizations
  • Other
gender One of the following strings:
  • m
  • f
  • Unknown
market A string that contains the ISO 3166 country code of the market where the acquisition occurred.
osVersion One of the following strings:
  • Windows Phone 7.5
  • Windows Phone 8
  • Windows Phone 8.1
  • Windows Phone 10
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 11
  • Unknown
deviceType One of the following strings:
  • PC
  • Phone
  • Console-Xbox One
  • Console-Xbox Series X
  • IoT
  • Holographic
  • Unknown
orderName A string that specifies the name of the order for the promotional code that was used to acquire the add-on (this only applies if the user acquired the add-on by redeeming a promotional code).

Request example

The following examples demonstrates several requests for getting add-on acquisition data. Replace the inAppProductId and applicationId values with the appropriate Store ID for your add-on or app.

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/inappacquisitions?inAppProductId=9NBLGGGZ5QDR&startDate=1/1/2015&endDate=2/1/2015&top=10&skip=0 HTTP/1.1
Authorization: Bearer <your access token>

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/inappacquisitions?applicationId=9NBLGGGZ5QDR&startDate=1/1/2015&endDate=2/1/2015&top=10&skip=0 HTTP/1.1
Authorization: Bearer <your access token>

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/inappacquisitions?inAppProductId=9NBLGGGZ5QDR&startDate=1/1/2015&endDate=7/3/2015&top=100&skip=0&filter=market ne 'US' and gender ne 'Unknown' and gender ne 'm' and market ne 'NO' and ageGroup ne '>55' HTTP/1.1
Authorization: Bearer <your access token>

Response

Response body

Value Type Description
Value array An array of objects that contain aggregate add-on acquisition data. For more information about the data in each object, see the add-on acquisition values section below.
@nextLink string If there are additional pages of data, this string contains a URI that you can use to request the next page of data. For example, this value is returned if the top parameter of the request is set to 10000 but there are more than 10000 rows of add-on acquisition data for the query.
TotalCount int The total number of rows in the data result for the query.

Add-on acquisition values

Elements in the Value array contain the following values.

Value Type Description
date string The first date in the date range for the acquisition data. If the request specified a single day, this value is that date. If the request specified a week, month, or other date range, this value is the first date in that date range.
inAppProductId string The Store ID of the add-on for which you are retrieving acquisition data.
inAppProductName string The display name of the add-on. This value only appears in the response data if the aggregationLevel parameter is set to day, unless you specify the inAppProductName field in the groupby parameter.
applicationId string The Store ID of the app for which you want to retrieve add-on acquisition data.
applicationName string The display name of the app.
deviceType string The type of device that completed the acquisition. For a list of the supported strings, see the filter fields section above.
orderName string The name of the order.
storeClient string The version of the Store where the acquisition occurred. For a list of the supported strings, see the filter fields section above.
osVersion string The OS version on which the acquisition occurred. For a list of the supported strings, see the filter fields section above.
market string The ISO 3166 country code of the market where the acquisition occurred.
gender string The gender of the user who made the acquisition. For a list of the supported strings, see the filter fields section above.
ageGroup string The age group of the user who made the acquisition. For a list of the supported strings, see the filter fields section above.
acquisitionType string The type of acquisition (free, paid, and so on). For a list of the supported strings, see the filter fields section above.
acquisitionQuantity integer The number of acquisitions that occurred.

Request and Response example

The following code snippet demonstrates an example request and JSON response body for those request.

Sample Request

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/inappacquisitions?applicationId=9NBLGGGZ5QDR
HTTP/1.1
Authorization: Bearer <your access token>

Sample Response

{
    "Value": [
        {
            "applicationId": "9NBLGGGZ5QDR",
            "inAppProductName": "Deluxe Collector's Edition",
            "addonProductId": "9NBLGGAAGZDQ",
            "date": "2022-07-29",
            "acquisitionQuantity": 1,
            "purchasePriceUSDAmount": 18.12,
            "purchasePriceLocalAmount": 18.12,
            "purchaseTaxUSDAmount": 1.13,
            "purchaseTaxLocalAmount": 1.13
        },
        {
            "applicationId": "9NBLGGGZ5QDR",
            "inAppProductName": "Episode 4",
            "addonProductId": "9NAAAAAAAAAQ",
            "date": "2017-01-07",
            "acquisitionQuantity": 1,
            "purchasePriceUSDAmount": 4.147206,
            "purchasePriceLocalAmount": 3.99,
            "purchaseTaxUSDAmount": 0.686004,
            "purchaseTaxLocalAmount": 0.66
        },
        {
            "applicationId": "9NBLGGGZ5QDR",
            "inAppProductName": "Deluxe Collector's Edition",
            "addonProductId": "9NALGGGZ5QDQ",
            "date": "2018-04-01",
            "acquisitionQuantity": 1,
            "purchasePriceUSDAmount": 1.99,
            "purchasePriceLocalAmount": 1.99,
            "purchaseTaxUSDAmount": 0.0,
            "purchaseTaxLocalAmount": 0.0
        },
        {
            "applicationId": "9NBLGGGZ5QDR",
            "inAppProductName": "Strategy Guide Episode 4",
            "addonProductId": "9NBLGGGZ5QDQ",
            "date": "2021-11-25",
            "acquisitionQuantity": 1,
            "purchasePriceUSDAmount": 1.31902922876179,
            "purchasePriceLocalAmount": 150.0,
            "purchaseTaxUSDAmount": 0.114315866492689,
            "purchaseTaxLocalAmount": 13.0
        },
    ],
    "TotalCount": 4,
    "DataFreshnessTimestamp": "2022-07-29T05:54:00"
}