App Analytics
When This Skill Owns the Task
Use dx-app-analytics-query when the work involves:
- Creating
AppAnalyticsQueryRequestrecords via the REST/sObject API - Configuring
AppAnalyticsSettingsvia the Metadata API (simulation mode, opt-out) - Understanding the query lifecycle: New → Pending → Complete → Expired → Failed
- Choosing between dataType values: PackageUsageSummary, PackageUsageLog, SubscriberSnapshot
- File format and compression options for analytics downloads
- Time-range filtering with startTime, endTime, availableSince
- Troubleshooting failed or expired analytics queries
Delegate elsewhere when the user is:
- Running standard CRM SOQL queries → platform-soql-query
- Working with Data Cloud SQL or DMOs → retrieving-datacloud
- Building reports/dashboards on standard objects → reporting skills
- Deploying or retrieving generic metadata XML → deploying-metadata / retrieving-metadata
Available Types
AppAnalyticsQueryRequest (REST/sObject API)
An asynchronous query request that ISV partners use to retrieve usage analytics data for their managed packages from the ISV Intelligence Data Lake. Records are created via POST /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest and polled via GET /services/data/vXX.0/sobjects/AppAnalyticsQueryRequest/<id>. The system processes the query and provides a presigned download URL upon completion.
Fields (14 properties):
AppAnalyticsSettings (Metadata API)
Configuration settings for ISV App Analytics that control simulation mode and opt-out behavior. Deployed via the Metadata API (sf project deploy) or Tooling API.
Fields (2 properties):
Request Lifecycle
Common Patterns
Query Package Usage Summary (last 7 days)
Create a record via the REST API:
Poll the record via GET until RequestState reaches Complete, then download from DownloadUrl.
Incremental Data Retrieval
Set AvailableSince to the timestamp of your last successful query completion to avoid re-downloading data you already have.
Enable Simulation Mode for Testing
Deploy AppAnalyticsSettings via Metadata API with enableSimulationMode: true to query sample data without real subscribers.
High-Signal Gotchas
- AppAnalyticsQueryRequest is an sObject — create and poll records via the REST Data API (
/sobjects/AppAnalyticsQueryRequest), NOT via Metadata API XML deployment. - AppAnalyticsQueryRequest does NOT have Apex triggers and does NOT flow through custom objects or Flows.
- Download URLs expire — always check
DownloadExpirationTimebefore attempting download. EndTimeshould be set on an hour boundary for consistent results.AvailableSinceis inclusive — data indexed at exactly that timestamp will be included.PackageIdsuses 033-prefix IDs, not 04t (package version) IDs.- Data is processed asynchronously by the ISV Intelligence Data Lake infrastructure. There is no synchronous query option.
FileType: parquetwithFileCompression: snappygives optimal performance for large datasets.

