Import Revenue Data

Leverage the Mixpanel Revenue report to track total revenue numbers as well as customer lifetime value and revenue per paying user. How you import revenue data depends on whether you are trying to import revenue as a property of a purchase event or import transactions for use in Mixpanel’s Revenue report.

Import Data to Populate Mixpanel’s Revenue Report

Mixpanel tracks revenue using a user profile property called $transactions, which is a list containing specially formatted JSON objects, one for each purchase or transaction associated with the particular profile. Because the property is a list of JSON objects, it’s not possible to use the built-in CSV upload feature in Explore to import revenue data.

However, you can import revenue data and have future mixpanel.track_charge calls increment correctly moving forward by sending the data as base-64 encoded $transactions objects to the Engage endpoint using $append .

For example, to import a transaction by the user with distinct_id "123" for $20 at 9AM on January 3rd, 2016, you would send the following:

"$append": {
"$transactions": {
"$time": "2016-01-03T09:00:00",
"$amount": 20.00
"$token": "<your project token>",
"$distinct_id": "123"

Encoded and ready to be sent to the endpoint, it will look like this:

See more documentation on tracking revenue.

Because the $transactions property can’t be used like other properties as a filter (specifically for targeting notifications), it’s also a good idea when tracking revenue to create an additional user profile property called “Lifetime Revenue” (or similar) that you can use for filtering.

Did this answer your question?



Article is closed for comments.