Implement Mixpanel

Mixpanel maintains SDKs for easy implementation across many different platforms. Use the Ingestion API if there is not an SDK that supports your use case.

Follow the integration pages to programmatically implement Mixpanel with an SDK. In addition to event tracking, the integration pages cover Mixpanel dependencies such as identity management, group implementation, etc.

Use the HTTP specification for implementations that do not use an SDK. This includes server-side implementations that do not have a library, and can accommodate implementing on any device with a network connection, such as an “internet of things” device.

Getting Started

View the Getting Started section of our Help Center if you are new to Mixpanel and looking for product basics and not implementation basics.

Tracking Plan

It is important to build a tracking plan before implementing Mixpanel. A tracking plan connects a Mixpanel implementation to goals and performance indicators, optimizing your Mixpanel use case.

Your tracking plan serves as a map for implementing Mixpanel and a reference ensuring that meaningful events and properties are being collected. It also guides the development process.

View sample tracking plans in the Help Center to get more detail.

Mixpanel SDKs

Mixpanel offers an array of both client-side and server-side libraries. The client refers to the browser or app that your end users interact with. The server hosts the information that the end user’s browser or app displays. This article is going to explain the differences between server-side and client-side SDKs so that you can decide how to track each event.

Some events are better tracked directly from the end user’s device, like selecting Sign Up. Other events are better tracked from your server, like a transaction.

For example, you may have a hybrid server-side and client-side implementation where users sign up on a website. The user clicks sign up and fills out a form, triggering a client-side event. The information the user fills out is sent to your server. You can send an event from your server to Mixpanel to confirm that the sign up is complete.

Client-Side SDKs

It’s better to track some events on the client-side SDK, such as actions taken in web pages and mobile applications. The following list outlines some of the advantages of client-side SDK tracking:

  • You can use super properties to send properties with every event, without having to manually add them to each event.
  • The client-side SDKs automatically assign a distinct ID to any user that performs an even on your site or app.
  • You can find a list of the default properties in this article. Default properties help you track important properties with every event, without having to manually add them. For example, if you want to analyze how your premium users behave compared to your free users, you can register a “User Type” super property. With “User Type” as a super property, you can segment and filter all of your client-side events by the “User Type” property.
  • You can use the distinct_id that Mixpanel assigns each user help track anonymous users.

You can use the following client-side SDKs with Mixpanel:

Server-Side SDKs

It’s better to track some events using a server-side SDK. The following list outlines some of the advantages of server-side SDK tracking:

  • Server-side tracking lets you send data that you want to associate with your users to Mixpanel from your database, including revenue data. To ensure accuracy of revenue data, many Mixpanel users choose to send this data using one of the server-side libraries.

You can use the following server-side SDKs with Mixpanel:

Don't see an SDK listed here? Post to our Community Ideas page to request support for a new platform.

HTTP Specification

The, or Ingestion API, endpoint will ingest events, user information, and group information. If you send data using the proper JSON format, Mixpanel ingests and displays that data.

Mixpanel's ingestion capability allows you to track events on any device that is connected to a network.

Examples include IoT devices, hardware with a network connection (such as a drone with network capabilities), server-side implementations that do not have an SDK, or a server-side implementations that you want more granular control over.

View the HTTP Spec documentation to learn more.

Mixpanel APIs

Mixpanel supports a collection of APIs that can use Mixpanel functionality outside of the web application.

View this page to see an overview of Mixpanel APIs.

Implement Mixpanel

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.