Open Tracked/Integrations/Mixpanel tag for server Google tag manager

Mixpanel tag for server Google tag manager

Mixpanel accepts events over HTTP. A server container can send them with a distinct ID and an insert ID for deduplication.

4 min read · Updated October 26, 2026

EEvent in the containerTag calls MixpanelMixpanel project
In this guide
Key takeaways
  • Send events to Mixpanel's track endpoint with the project token, an event name, a distinct ID and properties.
  • Use an insert ID to avoid duplicates and the right regional host (US or EU).
  • Keep personal data out unless you have a basis, and respect consent.

Mixpanel is a product analytics tool used for event and funnel analysis. Sending events from a server container keeps the browser lighter and lets you send backend events too. This page shows the recipe in outline. Mixpanel's API changes, so check its documentation. See also GA4 in a server container and server-to-server tracking.

What you need

  • A Mixpanel project token.
  • Your project's data residency: standard (US) or EU, which use different hosts.
  • A stable distinct ID for the person.
Live view

Watch events arrive, live

A sample feed. In Open Tracked you see the same stream for your own store.

The request

const sendHttpRequest = require("sendHttpRequest");
const JSON = require("JSON");
const getEventData = require("getEventData");

const host = data.region === "eu" ? "api-eu.mixpanel.com" : "api.mixpanel.com";
const events = [{
  event: data.eventName,
  properties: {
    token: data.token,
    distinct_id: data.distinctId,
    time: data.timeSeconds,
    "$insert_id": data.insertId,
    value: data.value,
    currency: data.currency
  }
}];

sendHttpRequest("https://" + host + "/track", (statusCode) => {
  statusCode === 200 ? data.gtmOnSuccess() : data.gtmOnFailure();
}, {
  method: "POST",
  headers: { "Content-Type": "application/json", "Accept": "text/plain" },
  timeout: 3000
}, JSON.stringify(events));

Check Mixpanel's documentation for the current endpoint, authentication and property names.

Design the events

ChoiceAdvice
Event namesUse a naming scheme. Reuse your GA4 names for consistency
Distinct IDA stable ID: a user ID for logged-in people, a client ID for anonymous visitors, and merge when they log in
Insert IDThe order ID or event ID, so retries do not duplicate
PropertiesValue, currency, items, source. No e-mail or names unless required and consented
TimeUnix seconds, within the accepted window
Trusted

Brands that grow on cleaner data

Stores and agencies use Open Tracked to see which ads earn the sale.

Mixpanel profiles can hold personal data. Decide what you send, whether it needs consent, and whether to use the EU residency option. See GDPR and server-side tracking.

Test

  1. Send a test event in server Preview.
  2. Check the tag status and response.
  3. Check Mixpanel's live view for the event and its properties.
  4. Send the same insert ID twice and confirm it counts once.
0 of 6 done

A realistic example

A software company sends product events to Mixpanel from the browser and finds that about a fifth of sign-ups are missing, because blockers stop the browser requests. It routes the key events through its tagging server, with the user ID as the distinct ID for logged-in users and the client ID for anonymous visitors, and with the order or event ID as the insert ID. Mixpanel's sign-up count rises to match the company's database, and funnels that start with anonymous visitors and end with sign-ups finally join up when the visitor logs in. The company chooses the EU residency option and avoids sending e-mail addresses. Changing the route changed what the team could believe about its funnels.

Keep it healthy

Compare event counts in Mixpanel with your database or analytics once a week for the main events. Differences point to blocked, failed or duplicated sends. Keep your event names and properties in a short document so that the server tag and the browser code do not drift apart.

Set up in minutes

Connected in minutes

Add your domain, install the pixel, connect your ad platforms and watch the first events land.

Frequently asked questions

Can a server container send events to Mixpanel?

Yes, by calling Mixpanel's track endpoint from a tag with the project token and event data.

What is a distinct ID?

The identifier Mixpanel uses to recognise a person across events.

How do I avoid duplicate events?

Send an insert ID, such as the order or event ID.

Which host should I use?

The one that matches your project's data residency, US or EU.

Do I need consent?

Where the law requires it for the data you send.

Do I need spreadsheets to read my results?

No. Once tracking is live, the Open Tracked analytics shows spend, revenue, ROAS and profit, and you can ask Ari, the built-in AI assistant, questions about your own numbers in plain words. Ari's allowance depends on your analytics plan.

Is Open Tracked different from Open Track or Open Space Track?

No. Open Tracked is the official name of our server-side tracking platform, and the website is opentracked.io. Many people search for it as Open Track, OpenTrack or Open Space Track. All of them lead to the same product: server-side Google Tag Manager hosting, first-party analytics and a CRM pipeline.

Fix your tracking at the source

Open Tracked hosts your server-side Tag Manager, keeps first-party cookies alive and shows what each ad is really worth.

Open Tracked
Written by

The Open Tracked team

We build Open Tracked: server-side tracking hosting, analytics and the tools around them, for stores that spend on ads. Questions about this guide, or an idea for the next one?

Write to us Read the docs

Was this article helpful?

Comments

Loading comments...

Turn better tracking into better marketing performance

Start free