Skip to main content

Mixpanel

This page contains the setup guide and reference information for the Mixpanel source connector.

Prerequisites

To set up the Mixpanel source connector, you'll need a Mixpanel Service Account and it's Project ID, the Project Timezone, and the Project region (US or EU).

Set up the Mixpanel connector in Airbyte

  1. Log into your Airbyte Cloud or navigate to the Airbyte Open Source dashboard.
  2. Click Sources and then click + New source.
  3. On the Set up the source page, select Mixpanel from the Source type dropdown.
  4. Enter the name for the Mixpanel connector.
  5. For Authentication, select Service Account from the dropdown and enter the Mixpanel Service Account secret.
  6. For Project ID, enter the Mixpanel Project ID.
  7. For Attribution Window, enter the number of days for the length of the attribution window.
  8. For Project Timezone, enter the timezone for your Mixpanel project.
  9. For Start Date, enter the date in YYYY-MM-DD format. The data added on and after this date will be replicated. If left blank, the connector will replicate data from up to one year ago by default.
  10. For End Date, enter the date in YYYY-MM-DD format.
  11. For Region, enter the region for your Mixpanel project.
  12. For Date slicing window, enter the number of days to slice through data. If you encounter RAM usage issues due to a huge amount of data in each window, try using a lower value for this parameter.
  13. Click Set up source.

Supported sync modes

The Mixpanel source connector supports the following sync modes:

Note: Incremental sync returns duplicated (old records) for the state date due to API filter limitation, which is granular to the whole day only.

Supported Streams

Performance considerations

Syncing huge date windows may take longer due to Mixpanel's low API rate-limits (60 reqs per hour).

CHANGELOG

VersionDatePull RequestSubject
1.0.12023-10-1331377Use our base image and remove Dockerfile
1.0.02023-09-2730025Fix type of datetime field in engage stream; fix primary key for export stream.
0.1.412023-09-2630149Change config schema; set checkpointing interval; add suggested streams; add casting datetime fields.
0.1.402022-09-2030090Handle 400 error when the credentials become expired
0.1.392023-09-1530469Add default primary key distinct_id to Export stream
0.1.382023-08-3130028Handle gracefully project timezone mismatch
0.1.372023-07-2027932Fix spec: change start/end date format to date
0.1.362023-06-2727752Partially revert version 0.1.32; Use exponential backoff;
0.1.352023-06-1227252Add should_retry False for 402 error
0.1.342023-05-1521837Add "insert_id" field to "export" stream schema
0.1.332023-04-2525543Set should_retry for 104 error in stream export
0.1.322023-04-1125056Set HttpAvailabilityStrategy, add exponential backoff, streams export and annotations add undeclared fields
0.1.312023-02-1322936Specified date formatting in specification
0.1.302023-01-2722017Set AvailabilityStrategy for streams explicitly to None
0.1.292022-11-0218846For "export" stream make line parsing more robust
0.1.282022-10-0617699Fix discover step issue cursor field None
0.1.272022-09-2917415Disable stream "cohort_members" on discover if not access
0.1.262022-09-2817304Migrate to per-stream states.
0.1.252022-09-2717145Disable streams "export", "engage" on discover if not access
0.1.242022-09-2616915Added Service Accounts support
0.1.232022-09-1816843Add stream=True for export stream
0.1.222022-09-1516770Use "Retry-After" header for backoff
0.1.212022-09-1116191Improved connector's input configuration validation
0.1.202022-08-2215091Improve export stream cursor support
0.1.192022-08-1815739Update titile and description for Project Secret field
0.1.182022-07-2114924Remove additionalProperties field from schemas and specs
0.1.172022-06-0112801Acceptance tests fix, fixing some bugs for beta release
0.1.162022-05-3012801Add end_date parameter
0.1.152022-05-0412482Update input configuration copy
0.1.142022-05-0211501Improve incremental sync method to streams
0.1.132022-04-2712335Adding fixtures to mock time.sleep for connectors that explicitly sleep
0.1.122022-03-3111633Increase unit test coverage
0.1.112022-04-0411318Change Response Reading
0.1.102022-03-3111227Fix cohort id always null in the cohort_members stream
0.1.92021-12-078429Updated titles and descriptions
0.1.72021-12-018381Increased performance for discovery stage during connector setup
0.1.62021-11-258256Deleted date_window_size and fix schemas date type issue
0.1.52021-11-107451Support start_date older than 1 year
0.1.42021-11-087499Remove base-python dependencies
0.1.32021-10-307505Guarantee that standard and custom mixpanel properties in the Engage stream are written as strings
0.1.22021-11-027439Added delay for all streams to match API limitation of requests rate
0.1.12021-09-166075Added option to select project region

Build instructions

Build your own connector image

This connector is built using our dynamic built process. The base image used to build it is defined within the metadata.yaml file under the connectorBuildOptions. The build logic is defined using Dagger here. It does not rely on a Dockerfile.

If you would like to patch our connector and build your own a simple approach would be:

  1. Create your own Dockerfile based on the latest version of the connector image.
FROM airbyte/source-mixpanel:latest

COPY . ./airbyte/integration_code
RUN pip install ./airbyte/integration_code

# The entrypoint and default env vars are already set in the base image
# ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
# ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

Please use this as an example. This is not optimized.

  1. Build your image:
docker build -t airbyte/source-mixpanel:dev .
# Running the spec command against your patched connector
docker run airbyte/source-mixpanel:dev spec

Customizing our build process

When contributing on our connector you might need to customize the build process to add a system dependency or set an env var. You can customize our build process by adding a build_customization.py module to your connector. This module should contain a pre_connector_install and post_connector_install async function that will mutate the base image and the connector container respectively. It will be imported at runtime by our build process and the functions will be called if they exist.

Here is an example of a build_customization.py module:

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
# Feel free to check the dagger documentation for more information on the Container object and its methods.
# https://dagger-io.readthedocs.io/en/sdk-python-v0.6.4/
from dagger import Container


async def pre_connector_install(base_image_container: Container) -> Container:
return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "my_pre_build_env_var_value")

async def post_connector_install(connector_container: Container) -> Container:
return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "my_post_build_env_var_value")

| 0.1.0 | 2021-07-06 | 3698 | Created CDK native mixpanel connector |