You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add per-event Properties sections and align event docs with SDK (#82)
* docs: add per-event Properties sections and align event docs with SDK
- Add a `## Properties` table to each event page (page, identify, detect,
connect, disconnect, chain, signature) derived from the SDK's EventFactory
- Merge page.mdx's `## Fields` + `## Properties` into a single `## Properties`
section with per-SDK source columns
- Move `address`/`user_id` to the top level in sample payloads to match the
SDK (they are common fields, not properties)
- Correct transaction `status` enum (add `reverted`) and signature prose
(drop the nonexistent "signature hash")
- Note that decoded `function_args` are flattened into top-level properties
- Remove the `## Fields` section from track.mdx
- Rename overview "API call" column to "Event type" and retitle the page to
"Events overview"
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: refresh track event page as "Custom events"
- Retitle to "Custom events" and update the description/intro
- Add a minimal custom-event JSON example in the Properties section
- Move the revenue tracking image to after the reserved-properties table
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: data/events/overview.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: 'Event spec overview'
2
+
title: 'Events overview'
3
3
description: "Learn how to send event data to Formo's APIs and the correct format for capturing events with SDKs, including identify, track, connect, and transaction calls."
4
4
---
5
5
6
6
## Events API
7
7
8
8
The Events API supports the following event types, each capturing key touchpoints in the user journey:
9
9
10
-
|API call| Description |
11
-
| :------- | :---------- |
10
+
|Event type| Description |
11
+
| :---------| :---------- |
12
12
|[Identify](/data/events/identify)| Identifies a visitor or user |
13
13
|[Detect](/data/events/detect)| Identifies a user's wallet provider |
14
14
|[Track](/data/events/track)| Records a custom event with arbitrary data |
Copy file name to clipboardExpand all lines: data/events/page.mdx
+13-23Lines changed: 13 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,32 +7,22 @@ The `page` event records whenever a user views a page on your website or a scree
7
7
8
8
On web, page properties are automatically collected from the browser. On mobile, the screen name is mapped to page-equivalent fields (`page_title`, `page_path`, `page_url`) so that web and mobile views are processed through the same analytics pipeline.
9
9
10
-
## Fields
11
-
12
-
Apart from the [common fields](/data/events/common), the `page` call accepts the following properties:
13
-
14
-
| Property | Type | Description |
15
-
|:---------|:-----|:------------|
16
-
|`url`| String | Full URL of the page. |
17
-
|`path`| String | Path component of the URL (without query string or hash). |
18
-
|`hash`| String | Hash fragment of the URL (e.g., `#section`). |
19
-
|`query`| String | Query string of the URL (without the leading `?`). |
20
-
|`name`| String | Name of the page or screen. |
21
-
|`category`| String | Category of the page or screen. |
22
-
|`title`| String | Title of the page. |
23
-
24
10
## Properties
25
11
26
-
The following table shows which properties are automatically set by each SDK:
12
+
| Property | Type | Description | Web SDK | Mobile SDK |
Copy file name to clipboardExpand all lines: data/events/track.mdx
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: 'Track event'
3
-
description: 'Reference for the Track API call used to record custom user actions like button clicks and purchases, with naming conventions and property schemas.'
2
+
title: 'Custom events'
3
+
description: 'Reference for the custom events used to record custom user actions and in-app behaviour.'
4
4
---
5
5
6
-
The Track API call is how you record any [custom events](/features/product-analytics/custom-events) your users are doing,
6
+
Record any [custom events](/features/product-analytics/custom-events)in your app,
7
7
along with properties that describe the action.
8
8
9
9
Custom events can capture a broad range of actions, such as clicking a button or completing a purchase.
@@ -20,32 +20,29 @@ When naming events, Formo recommends establishing a consistent naming convention
20
20
21
21
This allows everyone including you 6 months from now to instantly understand the meaning of an event.
22
22
23
-
## Fields
24
-
25
-
Apart from the [common fields](/data/events/common), the `track` call accepts the following fields:
26
-
27
-
| Field | Type | Required | Description |
28
-
|:------|:-----|:---------|:------------|
29
-
|`event`| String | ✓ | Name of the user action |
30
-
|`properties`| Object || Includes the properties associated with the event. For more information, check the Properties section below. |
31
-
32
-
33
23
## Properties
34
24
35
25
Properties are additional information that give more clarity of your users' actions.
36
26
27
+
Every custom event has `type` set to `track` and `event` set to your custom event name, with the event-specific data passed in the `properties` object:
28
+
29
+
```json
30
+
{
31
+
"type": "track",
32
+
"event": "Swap Reviewed",
33
+
"properties": {
34
+
"rating": 5
35
+
}
36
+
}
37
+
```
38
+
37
39
Formo has reserved some standard properties listed in the following table and handles them in a special manner.
38
40
39
41
### Tracking volume, revenue, points
40
42
41
43
You can track `volume`, `revenue`, and `points` in your events.
Include these optional properties in a custom event to track values associated with an action.
50
47
51
48
| Property | Type | Description |
@@ -55,6 +52,9 @@ Include these optional properties in a custom event to track values associated w
55
52
|`currency`| String | The currency of the revenue as a result of the event, set in ISO 4217 format. If this is not set, Formo assumes the revenue is in USD. |
56
53
|`points`| String | An abstract value such as points or XP associated with an event, to be used by various teams. |
Copy file name to clipboardExpand all lines: data/events/transaction.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,24 @@ description: 'Reference for the transaction event, including status tracking for
4
4
---
5
5
6
6
The `transaction` event is emitted whenever the user performs a transaction.
7
-
It includes the transaction status (started, broadcasted, confirmed, reverted, rejected), to address, data, value, transaction hash, chain ID, and wallet address.
7
+
It includes the transaction status (started, broadcasted, confirmed, reverted, rejected), recipient address, data, value, transaction hash, chain ID, and wallet address.
8
8
9
9
## Properties
10
10
11
11
| Property | Type | Description |
12
12
|----------|------|-------------|
13
-
|`status`|string| Transaction status: `started`, `broadcasted`, `confirmed`, `reverted`, or `rejected`|
|`value`|String| Transaction value (hex-encoded) |
18
+
|`transaction_hash`|String| Transaction hash (available after broadcast) |
19
+
|`function_name`|String| Decoded function name (if contract interaction) |
20
+
|`function_args`|Object| Decoded function arguments (if contract interaction) |
21
+
|`builder_codes`|String| Comma-separated [builder codes](#builder-codes) extracted from the transaction calldata (ERC-8021) |
22
22
23
23
<Note>
24
-
Decoded function arguments appear **both** as the nested `function_args`object and flattened into individual top-level properties for easier querying (e.g. `function_args.text` is also emitted as `text`). Nested struct fields are flattened with underscores (e.g. `order.maker` → `order_maker`), and any argument whose name collides with a reserved field is prefixed with `arg_` (e.g. `to` → `arg_to`).
24
+
Each entry in `function_args`is also flattened into the event's top-level properties for easier querying. For example, `function_args: { foo: "bar" }` also adds `foo: "bar"` as a property.
0 commit comments