eealeivan / mixpanel-csharp

Mixpanel C# integration library
MIT License
63 stars 15 forks source link

Track request is not being successful #9

Closed xth1 closed 6 years ago

xth1 commented 6 years ago

I am using the version 4.0.1 on a Xamarin project and I am using a valid mixpanel token. On my latest tests today none of the tracking requests is being successful ( I added a debug for the Track method). Any hint about that?

eealeivan commented 6 years ago

Hi,

I will check it and get back here.

On Mon, Nov 20, 2017 at 11:04 PM, Thiago da Silva Arruda < notifications@github.com> wrote:

I am using the version 4.0.1 on a Xamarin project and I am using a valid mixpanel token. On my latest tests today none of the tracking requests is being successful ( I added a debug for the Track method). Any hint about that?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eealeivan/mixpanel-csharp/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvzwP5bjIys43faVF69bR0MNE_mxbxLks5s4elugaJpZM4Qk5ZI .

Bhagwat-23 commented 6 years ago

Hello eealeivan,

First of all thanks for providing such a helpful APIs for mixpanel , you have really done a great job 👍 Kudos :) I've one question , have you written any APIs to consume or export event data and user data for client side? I can see some export data official APIs are available in mixpanel , are you planning to integrate it with .NET?

eealeivan commented 6 years ago

@Bhagwat-23 Hi, thanks! I haven't touched export API yet. At the moment I don't have a plans to integrate it to .NET too :(

eealeivan commented 6 years ago

@xth1 Hi, sorry that my reply took so long. I just tested it with simple Xamarin app and it worked OK.

So I just created Blank Android App in VS 2017 and used all default settings. Then I added one button to the main view and used this code:

[Activity(Label = "Mixpanel.Xamarin", MainLauncher = true)]
public class MainActivity : Activity
{
    private MixpanelClient mixpanelClient;

    protected override void OnCreate(Bundle savedInstanceState)
    {
        base.OnCreate(savedInstanceState);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);

        mixpanelClient = new MixpanelClient("{YOUR TOKEN}");
        MixpanelConfig.Global.SerializeJsonFn = JsonConvert.SerializeObject;

        FindViewById<Button>(Resource.Id.btnMixpanel).Click += async (sender, e) =>
        {
            await mixpanelClient.TrackAsync("Test", new { Timespan = DateTime.UtcNow.ToString("G") });
        };
    }
}

If it still silently fails for you then maybe you can try enable logging https://github.com/eealeivan/mixpanel-csharp/wiki/Configuration#error-logging