Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion libs/analytics-events/EVENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ No properties.

### Sent Cash

Cash was sent to a person or to several people, or a share of a payment request was paid. `Context` says which: Direct for a send to one person, Group Send for a send to several members of a group, Payment Request for paying a share. `Recipient Count` is the number of members paid and is sent for a Group Send only.
Cash was sent to a person or to several people, or a share of a payment request was paid. `Context` says which: Direct for a send to one person, Group Send for a send to several members of a group, Payment Request for paying a share, Send Back for returning a DM's opening payment. `Recipient Count` is the number of members paid and is sent for a Group Send only.

| Property | Type | Optional | Values |
|---|---|---|---|
Expand All @@ -313,6 +313,14 @@ Cash was sent to a person or to several people, or a share of a payment request

> **Drift:** iOS sends Exchange Rate and no USDC (see Amount).

### Send Back: Tapped

The receiver of a DM's opening payment tapped Send Back. `Has Balance` is false when their balance of the payment's token is too low, so the insufficient-balance modal showed instead of the confirm sheet.

| Property | Type | Optional | Values |
|---|---|---|---|
| Has Balance | yes/no | no | |

### Sent Tip

| Property | Type | Optional | Values |
Expand Down Expand Up @@ -806,6 +814,7 @@ The `Context` property on Sent Cash: which send the payment came from.
| Direct | `DIRECT` | |
| Group Send | `GROUP_SEND` | |
| Payment Request | `PAYMENT_REQUEST` | |
| Send Back | `SEND_BACK` | |

### AddMoneySource

Expand Down
12 changes: 11 additions & 1 deletion libs/analytics-events/events.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ description = "The `Context` property on Sent Cash: which send the payment came
DIRECT = "Direct"
GROUP_SEND = "Group Send"
PAYMENT_REQUEST = "Payment Request"
SEND_BACK = "Send Back"

[lists.AddMoneySource]
description = "The `Source` property on Add Money: Opened: where the user opened Add Money from."
Expand Down Expand Up @@ -595,9 +596,18 @@ properties = [
{ name = "Context", type = "SendContext", optional = true },
{ name = "Recipient Count", type = "count", optional = true },
]
description = "Cash was sent to a person or to several people, or a share of a payment request was paid. `Context` says which: Direct for a send to one person, Group Send for a send to several members of a group, Payment Request for paying a share. `Recipient Count` is the number of members paid and is sent for a Group Send only."
description = "Cash was sent to a person or to several people, or a share of a payment request was paid. `Context` says which: Direct for a send to one person, Group Send for a send to several members of a group, Payment Request for paying a share, Send Back for returning a DM's opening payment. `Recipient Count` is the number of members paid and is sent for a Group Send only."
drift = "iOS sends Exchange Rate and no USDC (see Amount)."

[[event]]
domain = "Transfer"
name = "Send Back: Tapped"
builder = "sendBackTapped"
properties = [
{ name = "Has Balance", type = "yes/no" },
]
description = "The receiver of a DM's opening payment tapped Send Back. `Has Balance` is false when their balance of the payment's token is too low, so the insufficient-balance modal showed instead of the confirm sheet."

[[event]]
domain = "Transfer"
name = "Sent Tip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ class TransferEventsTest {
assertEquals(PropertyValue.Text("Direct"), context(SendContext.DIRECT))
assertEquals(PropertyValue.Text("Group Send"), context(SendContext.GROUP_SEND))
assertEquals(PropertyValue.Text("Payment Request"), context(SendContext.PAYMENT_REQUEST))
assertEquals(PropertyValue.Text("Send Back"), context(SendContext.SEND_BACK))
}

@Test
fun sendBackTappedCarriesHasBalance() {
assertEquals(
AnalyticsEvent("Send Back: Tapped", mapOf("Has Balance" to PropertyValue.Flag(true))),
TransferEvents.sendBackTapped(true),
)
assertEquals(
AnalyticsEvent("Send Back: Tapped", mapOf("Has Balance" to PropertyValue.Flag(false))),
TransferEvents.sendBackTapped(false),
)
}

@Test
Expand Down
Loading