Appearance
Track Event
Track feature usage, user behavior, and deactivation reasons from your product.
POST /public/v1/eventRequest
json
{
"public_key": "pk_your_public_key",
"event": "feature_used",
"properties": {
"feature": "export",
"format": "csv"
},
"license_key": "MYPLUGIN-XXXX-XXXX-XXXX-XXXX",
"site": "customer.example.com"
}| Field | Type | Required | Description |
|---|---|---|---|
public_key | string | Yes | Your product's public key |
event | string | Yes | Event name (see below) |
properties | object | No | Event-specific data |
license_key | string | No | Attribute event to a customer license |
site | string | No | Domain identifier; defaults to client hostname |
Common Events
| Event | Description | Properties |
|---|---|---|
feature_used | User used a feature | { feature: "export", format: "pdf" } |
product.installed | Plugin/product installed | { env: { php, wp, … }, plugins: [...] } — see Install Tracking |
product.uninstalled | Plugin/product uninstalled | { reason, feedback, env: { ... } } — see Install Tracking |
settings_changed | Settings modified | { setting: "theme", value: "dark" } |
error_occurred | Error happened | { code: "E001", message: "..." } |
Event names that start with license., update., release., product., or site. are reserved by PackEdge for internal events and won't appear in the Feature Usage dashboard. Pick anything else.
Response
json
{
"success": true
}JS SDK
The simplest path is the official package — see the JavaScript SDK docs for installation, the full API surface, and event-naming conventions.
bash
npm install @packedge/js-sdkjavascript
import packedge from '@packedge/js-sdk';
packedge.init('pk_your_public_key', {
licenseKey: 'MYPLUGIN-XXXX-XXXX-XXXX-XXXX', // optional
});
packedge.track('feature_used', {
feature: 'export',
format: 'pdf',
});The SDK uses navigator.sendBeacon when available, falls back to fetch(..., { keepalive: true }), and never throws — safe to call from your customers' browsers.
<script> tag
html
<script src="https://unpkg.com/@packedge/js-sdk/dist/index.global.js"></script>
<script>
packedge.init('pk_your_public_key');
packedge.track('feature_used', { feature: 'export' });
</script>REST (no build step)
If you can't pull a JS package — e.g. inside a WordPress plugin — POST directly. Set blocking: false / keepalive: true so analytics never slow your app down.
JavaScript
javascript
fetch('https://api.packedge.dev/public/v1/event', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
keepalive: true,
body: JSON.stringify({
public_key: 'pk_your_public_key',
event: 'feature_used',
properties: { feature: 'export' },
}),
});PHP (WordPress)
php
wp_remote_post('https://api.packedge.dev/public/v1/event', [
'body' => json_encode([
'public_key' => 'pk_your_public_key',
'event' => 'feature_used',
'license_key'=> $license_key,
'site' => parse_url(home_url(), PHP_URL_HOST),
'properties' => ['feature' => 'export'],
]),
'headers' => ['Content-Type' => 'application/json'],
'blocking' => false,
]);Viewing analytics
Events show up in the PackEdge Console under each product's Analytics → Feature Usage tab:
- Per-feature cards with sparklines and period-over-period deltas
- Adoption rate (unique licenses ÷ active licenses)
- Day-of-week × hour usage heatmap
- Quiet/abandoned features
- Top licenses and domains
Privacy
- Events are anonymous by default — no PII required.
- Pass
license_keyto attribute usage to a customer. - Respect user consent before tracking.
