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
Copy file name to clipboardExpand all lines: README.md
+8-23Lines changed: 8 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -193,33 +193,18 @@ var revenue = new amplitude.Revenue().setProductId('com.company.productId').setP
193
193
amplitude.logRevenueV2(revenue);
194
194
```
195
195
196
-
`productId`, `price`, and `quantity` are required fields. Each field has a corresponding `set` method (for example `setProductId`, `setQuantity`, etc), as well as a corresponding event property key (see below for how to send revenue properties in event properties). This table describes the different fields available:
196
+
`productId` and `price` are required fields. `quantity` defaults to 1 if not specified. Each field has a corresponding `set` method (for example `setProductId`, `setQuantity`, etc). This table describes the different fields available:
197
197
198
-
| Name | Type | Description | default | property key |
| productId | String | Required: an identifier for the product (we recommend something like the Google Play Store product Id) | null |
201
+
| quantity | Integer | Required: the quantity of products purchased. Defaults to 1 if not specified. Revenue = quantity * price | 1 |
202
+
| price | Double | Required: the price of the products purchased (can be negative). Revenue = quantity * price | null |
203
+
| revenueType | String | Optional: the type of revenue (ex: tax, refund, income) | null |
204
+
| revenueProperties | Object | Optional: an object of event properties to include in the revenue event | null |
205
205
206
206
Note: the price can be negative, which might be useful for tracking revenue lost, for example refunds or costs.
207
207
208
-
### Sending Revenue as Event Properties ###
209
-
210
-
Instead of sending revenue through Amplitude's special revenue event, you can send revenue properties as event properties on any event you log. The`property key` column in the above table denotes the string key to use when declaring the eventproperty. Note: you still need to set a productId and a price. If quantity is not set, it is assumed to be 1:
The existing `logRevenue` methods still work but are deprecated. Fields such as `revenueType` will be missing from events logged with the old methods, so Revenue segmentation on those events will be limited in Amplitude dashboards.
0 commit comments