Events are the core of Mixpanel's Data Model. All events have a name, a timestamp, and a user ID. Events can optionally have a set of properties, which describe the event in more detail.
- If you're familiar with databases, events are like tables and properties are like columns.
- If you're familiar with Google Analytics, events are like hits and properties are like dimensions.
Page Viewedevent might have a property called
Page URL, which is set to the URL of the page that was viewed.
Signed Upevent might have a property called
Signup Type, which indicates whether the signup was
Song Playedevent might have a property called
Song Name, which is set to the name of the song that was played.
Order Completedevent might have a property called
Items, which is a list of objects, each of which contains details about an item, like its name, category, and price.
You can filter, breakdown, and aggregate your events by their properties to answer more questions:
- Which pages do users look at before they visit the pricing page?
- How many Signups did I get that were organic vs referral?
- Which Song Name is most popular among my users?
- How many Orders contain shoes? What is the sum total price that users paid for shoes in the last month?
Keep Events Generic
We recommend keeping event names generic and using properties for all context. For example:
- Instead of tracking events called
Home Page Viewedand
Pricing Page Viewed, track a
Page Viewedevent with a
Page Nameproperty set to
- Instead of tracking
Blue Button Clickedor
Checkout Button Clicked, track
Button Clickedwith a
Colorproperty set to
Button Nameset to
Name Events and Properties Consistently
We recommend having a consistent naming convention for your events and properties. For example:
- Use camel case for your event names.
- Use the
(Object) (Verb)format for event names. Like "Song Played" or "Page Viewed".
Avoid Creating Event or Property Names Dynamically
For example, don't create an event name like
Purchase (11-01-2019). Instead, create an event called Purchase and have some property (eg:
Return Date) set to the dynamic value
What types of data can I send as properties?
Mixpanel accepts arbitrary JSON as properties, including strings, numbers, booleans, lists, and objects. See our API docs (opens in a new tab) for more details.
What are the limits of events and properties?
We don't have a limit on the total number of events you can send to Mixpanel, but it will factor into your pricing (opens in a new tab).
We have a soft limit of 2000 distinct event names in a 30 day window. If you send more event names, we'll still ingest them, but those event names will not be indexed and will not appear in our autocomplete menus.
Each event can have up to 2000 properties. Properties can be at most 255 characters in length (longer strings are truncated).