appstore-connect-sdk icon indicating copy to clipboard operation
appstore-connect-sdk copied to clipboard

App Analytics

Open chessbyte opened this issue 2 years ago • 2 comments

Tried to get App Analytics working, but did not get all the way through with the following:

// Retrieve app analytics data for the TestFlight app
const getAppAnalyticsData = async (api: any) => {
  try {
    // Define the time period for the app analytics data you want to retrieve
    const startTime = Math.floor(Date.now() / 1000) - (24 * 60 * 60);
    const endTime = Math.floor(Date.now() / 1000);

    // Define the query parameters for the App Store Connect API request
    const queryParams: QueryParams = {
      'filter[timeRange][start]': startTime,
      'filter[timeRange][end]': endTime,
      'filter[version]': bundleId,
      'group[granularity]': 'DAY',
      'measure': 'installs,uninstalls'
    };

    const url = `/v1/analytics/applications/${appId}/data`;
    const method = 'GET';
    const data = await api.request(url, method, queryParams)
    return data;
  } catch (error) {
    console.error(error);
  }
};

Others are trying as well

  • https://developer.apple.com/forums/thread/718674
  • https://developer.apple.com/forums/thread/29421
  • https://developer.apple.com/forums/thread/115392?page=2

chessbyte avatar Jul 11 '23 19:07 chessbyte

I am also looking for a way to query analytics data. Unfortunately, Apple does not currently open the relevant API.

isaced avatar Nov 08 '23 03:11 isaced

This is helpful in any way? https://developer.apple.com/documentation/appstoreconnectapi/read_report_requests Its in the spec as apps-analyticsReportRequests-get_to_many_related

fdelucchijr avatar Aug 30 '24 19:08 fdelucchijr