取得每日應用程式使用量

在 Microsoft Store 分析 API 中使用此方法,在特定日期範圍期間 (僅限過去 90 天) 和其他選擇性篩選條件取得應用程式的 JSON 格式彙總使用量資料 (不包括 Xbox 多人遊戲)。 此資訊也可在合作夥伴中心的使用量報告中取得。

以 Anaheim 為基礎的 PWA 應用程式的遙測會在裝置層級收集。 因此,與使用者相關的計量不適用於這類產品。 如需功能變數有效性的詳細資訊,請參閱下列「使用量值」一節。

必要條件

要使用此方法,您需要先執行以下操作:

  • 如果您尚未執行此操作,請完成 Microsoft Store 分析 API 的所有必要條件
  • 取得 Azure AD 存取權杖以便用於此方法的要求標頭中。 取得存取權杖之後,您在其到期之前有 60 分鐘的時間可以使用。 權杖到期之後,您可以取得新的權杖。

要求

要求語法

方法 要求 URI
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/usagedaily

要求標頭

標題 類型 描述
授權 字串 必要。 持有人<權杖>形式的 Azure AD 存取權杖。

要求參數

參數 類型 描述 必要
applicationId 字串 您想要擷取評論資料之應用程式的 Store ID
startDate date 要擷取評論資料之日期範圍的開始日期。 預設值是目前的日期。
endDate date 要擷取評論資料之日期範圍的結束日期。 預設值是目前的日期。
熱門 int 要求中要傳回的資料列數。 如果未指定,則最大值和預設值為 10000。 如果查詢中有更多資料列,回應本文會包含下一個連結,您可以用來要求下一頁的資料。
skip int 要在查詢中忽略的列數。 使用此參數逐頁瀏覽大型資料集。 例如,top=10000 和 skip=0 會擷取前 10000 列資料,top=10000 和 skip=10000 會擷取接下來的 10000 列資料,依此類推。
篩選器 字串 篩選回應中的資料列的一或多個陳述式。 每個陳述式都包含回應本文的功能變數名稱,以及與 eq 或 ne 運算子相關聯的值,而且可以使用 and 或 or 結合陳述式。 字串值必須以 filter 參數中的單引號括住。 您可以從回應本文指定下列功能變數:
  • market
  • deviceType
  • packageVersion
orderby 字串 排序結果資料值的陳述式。 語法為 orderby=field [order],field [order],...。field 參數可以是下列其中一個字串:
  • date
  • applicationId
  • applicationName
  • market
  • packageVersion
  • deviceType
  • subscriptionName
  • dailySessionCount
  • engagementDurationMinutes
  • dailyActiveUsers
  • dailyActiveDevices
  • dailyNewUsers
  • monthlyActiveUsers
  • monthlyActiveDevices
  • monthlyNewUsers
  • dailyNewDevices
  • monthlyNewDevices

order 參數是選擇性的,而且可以是 ascdesc,以指定每個欄位的遞增或遞減順序。 預設為asc

以下是範例 orderby 字串:orderby=date,market

groupby 字串 僅將資料彙總套用至指定欄位的陳述式。 您可以從回應本文指定下列功能變數:
  • applicationName
  • subscriptionName
  • deviceType
  • packageVersion
  • market
  • date

傳回的資料列將包含 groupby 參數中指定的欄位,以及下列項目:

  • applicationId
  • subscriptionName
  • dailySessionCount
  • engagementDurationMinutes
  • dailyActiveUsers
  • dailyActiveDevices
  • dailyNewUsers
  • monthlyActiveUsers
  • monthlyActiveDevices
  • monthlyNewUsers
  • dailyNewDevices
  • monthlyNewDevices

groupby 參數可以搭配 aggregationLevel 參數使用。 例如:&groupby=ageGroup,market&aggregationLevel=week

要求範例

下列範例示範取得每日應用程式使用量資料的要求。 以您應用程式的 Store ID 取代 applicationId 值。

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/usagedaily?applicationId=XXXXXXXXXXXX&startDate=2018-08-10&endDate=2018-08-14 HTTP/1.1
Authorization: Bearer <your access token>

回應

回應本文

類型 描述
陣列 包含彙總使用量資料的物件陣列。 如需每個物件中資料的詳細資訊,請參閱下表。
@nextLink 字串 如果有額外的資料頁面,此字串會包含可用來要求下一頁資料的 URI。 例如,如果要求的 top 參數設定為 10000,但評論資料超過 10000 個資料列,則會傳回此值。
TotalCount int 查詢的資料結果中的總列數。

 

使用量值

Value 陣列中的元素包含下列值。

類型 描述 UWP 可用性 以 Anaheim 為基礎的 PWA 可用性 Xbox 可用性
date 字串 使用量資料之日期範圍中的第一個日期。 如果要求指定了單天,這個值就是該日期。 如果要求指定了一週、月或其他日期範圍,這個值就是該日期範圍中的第一個日期。
applicationId 字串 您正在擷取使用量資料之應用程式的 Store ID。
applicationName 字串 應用程式的顯示名稱。
deviceType 字串 下列其中一個字串,指定發生使用量的裝置類型:
  • PC
  • 手機
  • Console-Xbox One
  • Console-Xbox Series X
  • 平板電腦
  • IoT
  • Server
  • Holographic
  • Unknown
packageVersion 字串 發生使用量的套件版本。
market 字串 客戶使用您的應用程式之市場的 ISO 3166 國家/地區代碼。
subscriptionName 字串 指出使用量是否透過 Xbox Game Pass。
dailySessionCount long 當天的使用者工作階段數目。
engagementDurationMinutes double 依不同時間週期測量使用者主動使用應用程式的分鐘數,從應用程式啟動時開始 (處理序開始) 和終止 (處理序結束) 或一段閒置期間之後結束。
dailyActiveUsers long 當天使用應用程式的客戶數目。
dailyActiveDevices long 所有使用者用來與您的應用程式互動的每日裝置數目。
dailyNewUsers long 當天第一次使用您的應用程式的客戶數目。
monthlyActiveUsers long 當月使用應用程式的客戶數目。
monthlyActiveDevices long 不同時段內執行您的應用程式的裝置數目,從應用程式啟動時 (處理序開始) 開始,並在終止 (處理序結束) 或一段閒置期間之後結束。
monthlyNewUsers long 當月第一次使用您的應用程式的客戶數目。
dailyNewDevices long 當天第一次使用應用程式的裝置數目。
monthlyNewDevices long 過去 30 天內第一次使用應用程式的裝置數目。

注意

如果功能變數對特定產品無效,則回應中會將這些欄位的值傳送為 0 或 Null。 新使用者和新裝置的計算是使用 3 年的滾動期間來完成,也就是如果使用者/裝置未使用應用程式 3 年以上,則會在 3 年後被視為新的使用者/裝置。

要求和回應範例

下列程式碼片段示範一些要求的範例要求和 JSON 回應本文。

範例要求

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

範例回應

{
    "Value": [
        {
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "deviceType": "All",
            "packageVersion": "All",
            "market": "All",
            "dailySessionCount": 6102,
            "engagementDurationMinutes": 75801.0,
            "dailyActiveUsers": 3866,
            "dailyActiveDevices": 3855,
            "dailyNewUsers": 2041,
            "monthlyActiveUsers": 85206,
            "monthlyActiveDevices": 88995,
            "monthlyNewUsers": 63184,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        }
    ],
    "TotalCount": 1
}

範例要求

GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/usagedaily?applicationId=9NBLGGGZ5QDR&startDate=06/19/2022&endDate=07/20/2022&top=10&skip=0&groupby=applicationName,subscriptionName,deviceType,packageVersion,market,date

HTTP/1.1
Authorization: Bearer <your access token>

範例回應

{
    "Value": [
        {
            "date": "2022-07-11",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "1.4.0.17837",
            "market": "BR",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 35.2,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 1,
            "monthlyActiveDevices": 1,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-07-04",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AD",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 2.7,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 1,
            "monthlyActiveDevices": 1,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-24",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AE",
            "dailySessionCount": 2,
            "engagementDurationMinutes": 2.9,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 2,
            "monthlyActiveDevices": 2,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-07-08",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AE",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 0.5,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 2,
            "monthlyActiveDevices": 2,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-26",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AO",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 1.2,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 1,
            "monthlyActiveDevices": 1,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-19",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AR",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 1.0,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 40,
            "monthlyActiveDevices": 40,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-20",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AR",
            "dailySessionCount": 2,
            "engagementDurationMinutes": 10.9,
            "dailyActiveUsers": 2,
            "dailyActiveDevices": 2,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 42,
            "monthlyActiveDevices": 42,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-21",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AR",
            "dailySessionCount": 6,
            "engagementDurationMinutes": 32.8,
            "dailyActiveUsers": 3,
            "dailyActiveDevices": 3,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 44,
            "monthlyActiveDevices": 43,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-22",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AR",
            "dailySessionCount": 1,
            "engagementDurationMinutes": 0.1,
            "dailyActiveUsers": 1,
            "dailyActiveDevices": 1,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 43,
            "monthlyActiveDevices": 42,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        },
        {
            "date": "2022-06-23",
            "applicationId": "9NBLGGGZ5QDR",
            "applicationName": "Contoso Demo",
            "subscriptionName": "null",
            "deviceType": "PC",
            "packageVersion": "2.5.2.34894",
            "market": "AR",
            "dailySessionCount": 2,
            "engagementDurationMinutes": 0.3,
            "dailyActiveUsers": 2,
            "dailyActiveDevices": 2,
            "dailyNewUsers": 0,
            "monthlyActiveUsers": 42,
            "monthlyActiveDevices": 42,
            "monthlyNewUsers": 0,
            "dailyNewDevices": 0,
            "monthlyNewDevices": 0
        }
    ],
    "@nextLink": "usagedaily?applicationId=9NBLGGGZ5QDR&startDate=2022/06/19&endDate=2022/07/21&groupby=applicationName,subscriptionName,deviceType,packageVersion,market,date&top=10&skip=10",
    "TotalCount": 765
}