How can I use mixpanel API?

前端 未结 6 1941
抹茶落季
抹茶落季 2021-02-04 14:34

I\'m not able to connect to mixpanel.

I have tried with a correct api_key and api_secret, like this:



    

        
6条回答
  •  后悔当初
    2021-02-04 15:26

    from the documentation:

    We do not have a JS client library, but we have implemented jsonp on the API backend. See the Wikipedia article for a brief overview. Our jsonp parameter is 'callback'. This parameter will not be used during signature calculation.

    https://mixpanel.com/docs/api-documentation/data-export-api#libs-js

    Assuming you calculate the signature correctly, the below example will work:

     $.getJSON('http://mixpanel.com/api/2.0/segmentation/?callback=?', {
                event: event,
                from_date: from_date,
                to_date: to_date,
                expire: expire,
                sig: sig,
                api_key: api_key
            }, function (result) {
                alert(result);
            });
    

提交回复
热议问题