Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -538,18 +538,21 @@ mixpanel.init('MIXPANEL-PROJECT-TOKEN', {
// Disabled initially to prevent race condition with RudderStack ID binding.
// Remove this line if you are not using heatmaps.
record_heatmap_data: false,


autocapture: false, //optional set to true if using Autocapture
loaded: function (mixpanel) {
window.rudderanalytics.ready(function() {
const rudderAnonymousId = rudderanalytics.getAnonymousId();
if (rudderAnonymousId) {
mixpanel.register({ $device_id: rudderAnonymousId, distinct_id : "$device:"+rudderAnonymousId });

// Enable heatmap data now that the correct device_id is registered.
// Remove this line if you are not using heatmaps.
if (rudderAnonymousId) {
// Idempotency guard prevents double-prefixing on repeat page loads.
if (!rudderAnonymousId.startsWith('$device:')) {
rudderanalytics.setAnonymousId('$device:' + rudderAnonymousId);
}

mixpanel.register({
$device_id: rudderAnonymousId,
distinct_id: '$device:' + rudderAnonymousId,
});
mixpanel.set_config({ record_heatmap_data: true });

}

// Patch track method to include sessionReplayProperties
Expand Down
Loading