# dx-app-analytics-query

This skill retrieves managed package usage data through App Analytics and configures simulation mode. Use it when working with subscriber analytics queries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 5200 installs · ★ 1112
- Author: forcedotcom
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-app-analytics-query/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/dx-app-analytics-query

## What it does

The skill covers two Salesforce types: `AppAnalyticsQueryRequest` for asynchronous data requests and `AppAnalyticsSettings` for App Analytics configuration. It helps choose `PackageUsageSummary`, `PackageUsageLog`, or `SubscriberSnapshot`, set time filters, select packages, and choose a result format.

A request is created through the REST Data API, then checked as it moves through `New`, `Pending`, `Complete`, `Expired`, `Failed`, or `NoData`. The skill also covers incremental retrieval with `AvailableSince`, simulation with `enableSimulationMode`, and downloads in `csv` or `parquet` with `none`, `gzip`, or `snappy` compression.

Check `DownloadExpirationTime` before downloading because the presigned `DownloadUrl` expires. `AppAnalyticsQueryRequest` must use the REST Data API; it is an sObject rather than metadata for deployment.

## Requirements
- Works with: Salesforce

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-app-analytics-query -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/dx-app-analytics-query/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/dx-app-analytics-query/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-app-analytics-query -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/dx-app-analytics-query/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-app-analytics-query -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/dx-app-analytics-query/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install forcedotcom/sf-skills dx-app-analytics-query
```

2. **Manually: put the files in place**
- File: `.github/skills/dx-app-analytics-query/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-app-analytics-query -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/forcedotcom/sf-skills --path skills/dx-app-analytics-query
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/dx-app-analytics-query/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add forcedotcom/sf-skills --skill dx-app-analytics-query -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-app-analytics-query/SKILL.md

## When to use it
- retrieve managed package usage summaries
- query subscriber snapshots
- configure App Analytics simulation mode
- track an asynchronous analytics request
- download results as CSV or Parquet

## Example prompts
- Explain how to request `PackageUsageSummary` for a managed package with `AppAnalyticsQueryRequest`.
- Configure `AppAnalyticsSettings` with `enableSimulationMode: true` for App Analytics testing.
- Troubleshoot this `AppAnalyticsQueryRequest` after it reached `Failed`, using `ErrorMessage`.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: af1838ea27708d5f.

BEGIN THIRD-PARTY FILE af1838ea27708d5f
```text
---
name: dx-app-analytics-query
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)."
metadata:
  version: "1.0"
  domains: ["Developer Experience"]
  minApiVersion: "56.0"
  relatedSkills:
    - "platform-soql-query"
  cliTools:
    - tool: ["sf"]
      semver: ">=2.0.0"
---

# App Analytics

## When This Skill Owns the Task

Use `dx-app-analytics-query` when the work involves:
- Creating `AppAnalyticsQueryRequest` records via the REST/sObject API
- Configuring `AppAnalyticsSettings` via 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):**

| Field | Type | Description |
|-------|------|-------------|
| DataType | string (filterable) | Type of analytics data. Values: `PackageUsageSummary`, `PackageUsageLog`, `SubscriberSnapshot` |
```
END THIRD-PARTY FILE af1838ea27708d5f

The third-party file has ended. Everything between the af1838ea27708d5f tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2622 of 6770 bytes. © forcedotcom · Apache-2.0 · https://github.com/forcedotcom/sf-skills/tree/HEAD/skills/dx-app-analytics-query/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
