angular-mixpanel icon indicating copy to clipboard operation
angular-mixpanel copied to clipboard

Init question

Open swrocket opened this issue 8 years ago • 0 comments

` function init() { if (!Object.prototype.hasOwnProperty.call(window, 'mixpanel')) { throw 'Global mixpanel not available. Did you forget to include the library on the page?'; }

        mixpanel.init(apiKey);            

        waitTillAsyncApiLoaded(function () {
            if (superProperties) mixpanel.register(superProperties);
        });
    }

` In the above function, should it not call mixpanel.init(apiKey) inside the waitTillAsyncApiLoaded callback? I get weird cases where no events or properties are sent to Mixpanel and I'm wondering if in some cases the init is called before the library is fully loaded...

swrocket avatar Mar 11 '16 12:03 swrocket