How do i set up Mixpanel for sending data to hotjar as an integration?
The knowledge sources do not contain information about sending data from Mixpanel to Hotjar as an integration. Mixpanel and Hotjar are separate tools, and the available documentation does not describe a native integration between them for data export. What the knowledge sources do mention is that Mixpanel can receive data from various sources (SDKs, CDPs like Segment, data warehouses, etc.) and can export cohorts to destinations via webhooks or native integrations. However, Hotjar is not listed among Mixpanel's supported integration destinations. [All Integrations] If you're looking to use both tools together, I'd recommend checking Hotjar's own documentation for any Mixpanel integration they may support on their end. You could also explore Mixpanel's integrations directory for the full list of supported partners.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
When using the CDN snippet method, the Mixpanel SDK is automatically exposed as a global window.mixpanel object. The snippet sets window.mixpanel = b before the library loads, so you can call mixpanel.* methods anywhere on the page immediately. [Installing the Library] Just paste the snippet before your closing </head> tag and call mixpanel.init():
<script type="text/javascript">
(function (f, b) { if (!b.__SV) { var e, g, i, h; window.mixpanel = b; /* ... full snippet ... */ } })(document, window.mixpanel || []);
mixpanel.init("YOUR_PROJECT_TOKEN", {
track_pageview: true,
});
</script>The key part is window.mixpanel = b inside the snippet โ this ensures mixpanel is globally accessible. [Installing the Library]
If you're using npm/yarn instead, the SDK is not automatically global. You import it as a module and use it within your JS files:
import mixpanel from 'mixpanel-browser';
mixpanel.init("YOUR_PROJECT_TOKEN", {
track_pageview: true,
persistence: "localStorage",
});If you need it globally in an npm setup, you can manually assign it after importing:
import mixpanel from 'mixpanel-browser';
window.mixpanel = mixpanel;However, the knowledge sources don't explicitly recommend this pattern โ it's generally better to import the module where needed rather than relying on a global.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
