Skip to content
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

Init question #27

Open
swrocket opened this issue Mar 11, 2016 · 0 comments
Open

Init question #27

swrocket opened this issue Mar 11, 2016 · 0 comments

Comments

@swrocket
Copy link

`
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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant