Skip to main content

How to sync customer profiles

In addition to tracking events, the extension can keep Mixpanel people profiles enriched with data from Magento - turning each customer into a rich profile you can segment and filter on.

What gets synced

For each eligible customer the following people properties are sent to Mixpanel:

  • $name, $email, $created (registration date)
  • customer_group
  • lifetime_value - total value of completed orders
  • order_count
  • first_order_at, last_order_at

Who gets synced

Only customers who have been identified on the storefront (i.e. logged in and loaded at least one page while the extension was active) are included in the automatic sync. Dormant accounts that never visited the storefront are never pushed to Mixpanel, keeping your Mixpanel profile count aligned with your actually active audience.

To sync a specific customer regardless of whether they were identified, use the --customer-id option of the CLI command (see below).

Prerequisites

The profile sync uses Mixpanel's server-side profile API, which requires a Service account. Configure the Service account username and Service account secret (and the correct Data residency) as described in How to connect a Mixpanel project. Without them, event tracking still works but profiles are not synced.

Automatic sync

A cron job (mst_mixpanel_sync_profiles) runs every day at 02:00 and syncs all eligible customers. A profile is only sent to Mixpanel when its data has changed since the previous sync, so the job stays lightweight even with a large customer base.

Manual sync

You can trigger the sync at any time from the command line:

# Sync all identified customers (same as the nightly cron)
bin/magento mirasvit:mixpanel:sync-profiles

# Sync a single customer, even if they were never identified on the storefront
bin/magento mirasvit:mixpanel:sync-profiles --customer-id=123

# Run the scheduled job immediately
bin/magento mirasvit:mixpanel:cron

See the CLI commands reference for details.