-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event tracking doesn't work in App Extension #1014
Comments
Troubleshooting Event Tracking Issue in App Extension with Swift Package Manager Integration Integration Details: Integration Method: Swift Package Manager Expected Behavior: Troubleshooting Steps: Logging and Debugging: Ensure that the event tracking code in the app extension is correctly implemented and that there are no errors during execution. Utilize Swift's debugging tools and print statements to log relevant information. Confirm that the Mixpanel configuration is consistent between the main app and the app extension. Check if the Mixpanel token and initialization code are identical. Verify that the app extension is allowed to run in the background, as events might not be sent if the extension is suspended or terminated before it has a chance to communicate with Mixpanel. Ensure that the device running the app extension has a stable internet connection. Events might not be sent if there are network issues. Check if the version of the Mixpanel SDK (5.0.2) is compatible with both the main app and the app extension. Consider updating to the latest version of the Mixpanel SDK if available. Review how the shortcut intent is triggering the event tracking within the app extension. Ensure that the logic for handling shortcut intents is correctly implemented. Double-check the Mixpanel dashboard filters to ensure that the event is not being filtered out. Adjust the dashboard settings to show events without any filters. Confirm that the app extension has the necessary permissions and authorizations to interact with Mixpanel. This includes any required app groups or entitlements. Check if the Mixpanel SDK is initialized at the appropriate time in the app extension lifecycle. Initialization should occur before attempting to track events. Refer to the Mixpanel documentation for any specific considerations or limitations related to using Mixpanel in app extensions. |
When using Mixpanel with App Extensions in an iOS app, it’s not uncommon to encounter issues where events seem to be tracked but don’t appear in the Mixpanel dashboard. Here are a few potential causes and solutions you can try: 1. App Extension and Main App Communication
Solution: To resolve this, try sending a network request or passing the event data from the app extension back to the main app (which has the Mixpanel SDK initialized). Once the app extension triggers the event, the main app should handle the tracking.
Mixpanel Debugging
Solution: Enable debug mode for Mixpanel to see the raw logs for any potential issues. Add this line when initializing Mixpanel: Mixpanel.debugLogs = true Check the logs to see if the event is being sent and if there are any errors. 6. Event Delay
Solution: Check the event logs after a delay (say, 30 minutes or more) and see if the event appears. Next Steps:
By checking these factors and implementing the solutions, you should be able to get your events showing up correctly on the Mixpanel dashboard. Let me know if you need more detailed code examples or further assistance! Hottu |
Here’s a shorter version of the troubleshooting steps for your Mixpanel app extension issue:
This should help you resolve the issue and track events properly in the Mixpanel dashboard! Online in UK |
Integration Method: Swift Package Manager
Xcode Version: 14.3.1
Library Version: 5.0.2
Platform: iOS / App Extension
Language: Swift
Description: When tracking an event within the App, everything works fine. However if I track an event within an app extension through a shortcut intent, it seems to track the event according to mixpanel logs, but it never shows up in the mixpanel dashboard.
Expected Behavior: event should show up in mixpanel dashboard
Thanks for any help in figuring this out :)
The text was updated successfully, but these errors were encountered: