Hi folks, I'm having trouble receiving any events in a new mixpanel project. We're using the react native SDK in an expo mobile app. We've set up a previous project in mixpanel and got events & user props coming through correctly (yay!). Now we've created a new mixpanel project and switched out the project token passed to mixpanel in the app const mixpanel = new Mixpanel(token), expecting the existing events to appear in the new project. No such luck! I've swapped the project token a few times and the issue is project-specific (i.e. the old token still works). I get no error messages and, because the old token still works fine, I'm assuming it's not an issue with my app (🤞?) As far as I can see both projects are set up identically in mixpanel. Any ideas of what's going wrong or how to debug this any further?
setting up mixpanel in our app:
import { Mixpanel, MixpanelProperties } from "mixpanel-react-native";
const useNative = false; // disable Native Mode because we're using RN + expo, instead use Javascript Mode
export const createAnalyticsClient = (
token: string,
trackAutomaticEvents = true,
persistentEventProperties: MixpanelProperties = {},
) => {
const superProperties: MixpanelProperties = {
application_id: applicationId,
application_name: applicationName,
app_version: nativeApplicationVersion,
build_version: __DEV__ ? "dev" : nativeBuildVersion,
device_name: deviceName,
device_type: deviceType ? DeviceType[deviceType] : undefined,
device_year_class: deviceYearClass,
is_simulator: !isDevice,
model_name: modelName,
model_id: modelId,
...persistentEventProperties,
};
const mixpanel = new Mixpanel(token, trackAutomaticEvents, useNative);
mixpanel.init(undefined, superProperties, "https://api-eu.mixpanel.com");
return mixpanel;
};
package versions: "mixpanel-react-native": "^3.1.2", "@react-native-async-storage/async-storage": "^1.24.0",
This request was closed and merged into request </agent/tickets/669384|#669384> "Bad project token?".
Received via system
Hi Anjali! Looks like Ross merged your other support ticket, so he will communicate through email with your question. Sorry about the confusion here 🙏
No worries 👍 For anyone else facing this issue: I created a brand new project in mixpanel (same setup as far as I can see), plugged the new project token into my app and it worked! I'm getting events through 🎉 I have no clue what was wrong with that one bad project but I'm deleting the bad project and proceeding with this brand new working project 🤷♀️
Hi Anjali, I will also close this thread out. Thanks again for confirming that it's working now 🙏 Let us know if we can help with anything else! Best, Ross
