Google Sheets

Overview

Mixpanel has a native extension for Google Sheets that enables you to import Sheets data to your Mixpanel project, and export your Mixpanel reports/cohorts to your Sheets.

The source code for this extension lives here (opens in a new tab).

Install the plugin

Visit the Sheets ⇔ Mixpanel Google Workspace Marketplace page (opens in a new tab) to install the extension. Learn more about the permissions requested here.

After installing, you will see the Sheets ⇔ Mixpanel dropdown under "extensions" in any Google Sheet. This module provides two modes, which are exposed in the main menu:

gsheets-main-menu
  • Sheet → Mixpanel: import event/user/group/table data from the current sheet.
  • Mixpanel → Sheet: export reports or cohort data from your mixpanel project

Each UI has a simple user interface, and is essentially a form you fill out that contains the necessary details to carry out your desired result.

Import from Google Sheet

Sheet → Mixpanel queries your currently active sheet to get your sheet's column headers.

Once you choose the type of data you are importing, you will use the visual mapper to connect the column headers from your sheet to the required fields for the type of mixpanel data you are importing:

gsheets-mapping

Here is a summary of Mixpanel's data model and required fields for event data:

  • event name: what to call each event in mixpanel
  • distinct_id: the unique user identifier to whom the event is attributed (learn more here)
  • time: a valid date or time; if the sheet recognizes your chosen column as a 'date' or time', it should work as intended
  • insert_id: a value used to deduplicate records (optional)

All other columns in your spreadsheet will get sent as properties (event, user, or group).

You will also need to provide the following details found in your project settings:

⚠️

Note: since v1.12 syncs are not supported for events.

Next, learn about runs and syncs below.

Export to Google Sheet

Mixpanel → Sheet queries your Mixpanel project for a report or cohort and makes the results available in a new Sheet.

This will replicate the functionality when exporting a CSV file from the Mixpanel UI.

There are a number of parameters needed to fetch a CSV from mixpanel. The simplest way to gather those parameters is to paste the URL of the report/cohort you wish to sync from your Mixpanel project, and the app should parse for them automatically:

gsheets-parse

In case the URL does not contain all the values you need, the UI requires:

⚠️

Note: since v1.12 insights, funnels, & retention are the only supported reports.

Next, learn about runs and syncs below.

Runs and Syncs

Each UI has a similar user interface for you to input your details with four key actions at the bottom:

gsheets-four-actions
  • Run: run the current configuration once; results are display in the UI
  • Sync: run the current configuration every hour; run receipts are stored in a log sheet
  • Save: store the current configuration
  • Clear: delete this sheet's sync and reload the UI

You may only have one sync active per sheet at a time. If you are planning to sync data from your sheet to Mixpanel, it is recommended that you do a "run" first.

Once created, syncs will run on an hourly schedule; they can also be manually triggered from the main menu by choosing Sync Now!:

gsheets-sync-now
⚠️

Note: since v1.12 syncs are not supported for events.

Permissions

Limited User Policy

Sheets™ ⇔ Mixpanel use and transfer to any other app of information received from Google APIs will adhere to Google API Services User Data Policy (opens in a new tab), including the Limited Use requirements.

The app is free to use and does not contain ads, nor will any data collected by Sheets™ ⇔ Mixpanel be resold in any way. No human can read your spreadsheets; usage data is collected and anonymized only to improve the end-user's experience.

Permissions

Using the principle of least-privilege, Sheets™ ⇔ Mixpanel requests access to three sensitive scopes to support application functionality, which are explained below:

  • https://www.googleapis.com/auth/script.container.ui is used to draw a dynamic UI which maps the columns headers of your currently active Google Sheet™ into dropdowns in the extension interface.
  • https://www.googleapis.com/auth/script.scriptapp is used to support scheduled hourly "sync" functionality so the pipeline you've configured in the UI can run automatically.
  • https://www.googleapis.com/auth/script.external_request is used to send your mapped data to mixpanel and to request your report/cohort data from mixpanel.

No other sensitive scopes are requested by the application.

Was this page useful?