by skotzko on 7/30/13, 4:28 PM with 5 comments
by msaspence on 7/30/13, 8:51 PM
If you use the integration code demonstrated in their docs here: https://mixpanel.com/help/reference/javascript, Mixpanel already has an event queue natively.
It sets the `mixpanel` variable to an array which which holds the event queue. It then defines functions on this array with the same names as those in the full library. When any of them are called the call is added to the event queue array.
When the full library loads, the array of queued events is placed in a temporary variable. The full library is loaded into the `mixpanel` variable and then the the queue is replayed by the full library.
analytics.js also works in this way
by skotzko on 7/30/13, 4:30 PM