samzilverberg/cordova-mixpanel-plugin

Can't see my data in mixpanel

Closed this issue · 3 comments

Hi,

I unsuccessfully tried to use your plugin to track events and "add people" to mixpanel. I get no errors while initializing it.

Here's my code, I wrapped it in a mixpanel service :

init: function () {
                mixpanel.init(
                    "MY_API_KEY",
                    function (data) {
                        mixpanel.distinctId(
                            function(data){
                                mixpanel.identify(
                                    function(data){
                                        mixpanel.people.set({
                                            test : "test"
                                        },
                                            this.err,
                                            this.err
                                        );
                                    },
                                    this.err
                                )
                            },
                            this.err
                        )
                    },
                    this.err
                )
            },

Help, I'm starting to feel very very stupid.

omg this is what callback hell looks like :)
it looks lie your using mixpanel.identify incorrectly.
you didnt pass in the identifier ("data") from the call to mixpanel.distinctId.

:)
happy it works for you, stupid stuff happens to us all!