If you would like to employ the help of a third-party Cordova plugin please see here.
Host Mixpanel Locally
Load the Mixpanel library from your local device with the following code:
Note that the only difference between the snippet above and the typical minified snippet is the file location for the Mixpanel library.
Setting Up Push Notifications
Mixpanel's methods for initializing push notifications are specific to our mobile SDK's, and will grab the device token and append it to the list properties $ios_devices or $android_devices. Replicate this logic either through grabbing and setting these properties from your backend, or including client-side logic to add this property via a mixpanel.people.append() call. Without the device tokens appended as a list property, Mixpanel won't be able to target users for push notifications.
Once you have the device tokens correctly uploaded, you'll need to generate your iOS push cert and GCM API key.
At this point you should be able to send out iOS push notifications from your Mixpanel Notifications dashboard. Android may be a little more complicated, as Mixpanel's Webapp generates pushes with JSON keys that are specific to the Mixpanel GCM receiver.
Mind the Queue
In regards to the time associated with these queued events, you will want to make sure you are time-stamping them correctly as you queue them so that even if they arrive at Mixpanel's /track API endpoints out of order, they will be stored under the correct time.
Note: it’s best practice to limit the number of calls at 40 per batch to ensure all calls are successful (as in Mixpanel's iOS Library).