@salesforce/afv-skills 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dx-app-analytics-use
|
|
3
|
+
description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use querying-soql), or Data Cloud query/search (use retrieving-datacloud)."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.0"
|
|
6
|
+
minApiVersion: "56.0"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# App Analytics
|
|
10
|
+
|
|
11
|
+
## When This Skill Owns the Task
|
|
12
|
+
|
|
13
|
+
Use `dx-app-analytics-use` when the work involves:
|
|
14
|
+
- Creating `AppAnalyticsQueryRequest` records via the REST/sObject API
|
|
15
|
+
- Configuring `AppAnalyticsSettings` via the Metadata API (simulation mode, opt-out)
|
|
16
|
+
- Understanding the query lifecycle: New → Pending → Complete → Expired → Failed
|
|
17
|
+
- Choosing between dataType values: PackageUsageSummary, PackageUsageLog, SubscriberSnapshot
|
|
18
|
+
- File format and compression options for analytics downloads
|
|
19
|
+
- Time-range filtering with startTime, endTime, availableSince
|
|
20
|
+
- Troubleshooting failed or expired analytics queries
|
|
21
|
+
|
|
22
|
+
Delegate elsewhere when the user is:
|
|
23
|
+
- Running standard CRM SOQL queries → querying-soql
|
|
24
|
+
- Working with Data Cloud SQL or DMOs → retrieving-datacloud
|
|
25
|
+
- Building reports/dashboards on standard objects → reporting skills
|
|
26
|
+
- Deploying or retrieving generic metadata XML → deploying-metadata / retrieving-metadata
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Available Types
|
|
31
|
+
|
|
32
|
+
### AppAnalyticsQueryRequest (REST/sObject API)
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
**Fields (14 properties):**
|
|
37
|
+
|
|
38
|
+
| Field | Type | Description |
|
|
39
|
+
|-------|------|-------------|
|
|
40
|
+
| DataType | string (filterable) | Type of analytics data. Values: `PackageUsageSummary`, `PackageUsageLog`, `SubscriberSnapshot` |
|
|
41
|
+
| RequestState | string (filterable) | Processing status. Values: `New`, `Pending`, `Complete`, `Expired`, `Failed`, `NoData`, `Delivered` |
|
|
42
|
+
| StartTime | string | Start of time range for requested data |
|
|
43
|
+
| EndTime | string | End of time range. Should be set on an hour boundary |
|
|
44
|
+
| AvailableSince | string | Limits query to data indexed after this time (inclusive). Use for incremental retrieval |
|
|
45
|
+
| PackageIds | string | Comma-delimited list of managed package IDs (033-prefix) |
|
|
46
|
+
| OrganizationIds | string | Comma-delimited list of subscriber org IDs to filter results |
|
|
47
|
+
| DownloadUrl | string | Presigned URL for downloading results. Populated when RequestState is Complete |
|
|
48
|
+
| DownloadSize | long | Size in bytes of the result data file |
|
|
49
|
+
| DownloadExpirationTime | string | Time at which the download URL expires |
|
|
50
|
+
| FileType | string (filterable) | Output format. Values: `csv`, `parquet` |
|
|
51
|
+
| FileCompression | string (filterable) | Compression. Values: `none`, `gzip`, `snappy` |
|
|
52
|
+
| QuerySubmittedTime | string | Time the query was submitted to the Data Lake |
|
|
53
|
+
| ErrorMessage | string | Diagnostic message for failed queries |
|
|
54
|
+
|
|
55
|
+
### AppAnalyticsSettings (Metadata API)
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
**Fields (2 properties):**
|
|
60
|
+
|
|
61
|
+
| Field | Type | Description |
|
|
62
|
+
|-------|------|-------------|
|
|
63
|
+
| enableSimulationMode | boolean (filterable) | When true, allows querying sample usage logs for integration testing without real subscriber data |
|
|
64
|
+
| enableAppAnalyticsOptOut | boolean (filterable) | When true, opts this subscriber org out of AppExchange App Analytics data collection |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Request Lifecycle
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
New → Pending → Complete → (download within expiration window)
|
|
72
|
+
→ Expired (download URL no longer valid)
|
|
73
|
+
→ Delivered (download confirmed received)
|
|
74
|
+
→ Failed (check errorMessage)
|
|
75
|
+
→ NoData (no matching records for the criteria)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Common Patterns
|
|
81
|
+
|
|
82
|
+
### Query Package Usage Summary (last 7 days)
|
|
83
|
+
|
|
84
|
+
Create a record via the REST API:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
POST /services/data/v60.0/sobjects/AppAnalyticsQueryRequest
|
|
88
|
+
Content-Type: application/json
|
|
89
|
+
|
|
90
|
+
{
|
|
91
|
+
"DataType": "PackageUsageSummary",
|
|
92
|
+
"StartTime": "<7-days-ago>T00:00:00Z",
|
|
93
|
+
"EndTime": "<today-on-hour-boundary>T00:00:00Z",
|
|
94
|
+
"PackageIds": "033XXXXXXXXXXXX",
|
|
95
|
+
"FileType": "csv",
|
|
96
|
+
"FileCompression": "gzip"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Poll the record via GET until `RequestState` reaches `Complete`, then download from `DownloadUrl`.
|
|
101
|
+
|
|
102
|
+
### Incremental Data Retrieval
|
|
103
|
+
|
|
104
|
+
Set `AvailableSince` to the timestamp of your last successful query completion to avoid re-downloading data you already have.
|
|
105
|
+
|
|
106
|
+
### Enable Simulation Mode for Testing
|
|
107
|
+
|
|
108
|
+
Deploy `AppAnalyticsSettings` via Metadata API with `enableSimulationMode: true` to query sample data without real subscribers.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## High-Signal Gotchas
|
|
113
|
+
|
|
114
|
+
- AppAnalyticsQueryRequest is an **sObject** — create and poll records via the REST Data API (`/sobjects/AppAnalyticsQueryRequest`), NOT via Metadata API XML deployment.
|
|
115
|
+
- AppAnalyticsQueryRequest does NOT have Apex triggers and does NOT flow through custom objects or Flows.
|
|
116
|
+
- Download URLs expire — always check `DownloadExpirationTime` before attempting download.
|
|
117
|
+
- `EndTime` should be set on an hour boundary for consistent results.
|
|
118
|
+
- `AvailableSince` is inclusive — data indexed at exactly that timestamp will be included.
|
|
119
|
+
- `PackageIds` uses 033-prefix IDs, not 04t (package version) IDs.
|
|
120
|
+
- Data is processed asynchronously by the ISV Intelligence Data Lake infrastructure. There is no synchronous query option.
|
|
121
|
+
- `FileType: parquet` with `FileCompression: snappy` gives optimal performance for large datasets.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Output Format
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
Analytics task: <query / configure / troubleshoot>
|
|
129
|
+
Data type: <PackageUsageSummary / PackageUsageLog / SubscriberSnapshot>
|
|
130
|
+
Package IDs: <033-prefixed IDs>
|
|
131
|
+
Time range: <startTime> to <endTime>
|
|
132
|
+
File format: <csv|parquet> / <none|gzip|snappy>
|
|
133
|
+
Request state: <current state>
|
|
134
|
+
Next step: <poll for completion / download / investigate failure>
|
|
135
|
+
```
|