GithubHelp home page GithubHelp logo

jayj / mixpanel-csharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eealeivan/mixpanel-csharp

0.0 0.0 0.0 1.35 MB

Mixpanel C# integration library

License: MIT License

C# 98.60% PowerShell 1.40%

mixpanel-csharp's Introduction

mixpanel-csharp NuGet Version

Mixpanel is a great analitics platform, but unfortunetally there is no official integration library for .NET. So if you are writing code on .NET and want to use Mixpanel, then mixpanel-csharp can be an excellent choice. mixpanel-csharp main idea is to hide most api details (you don't need to remember what time formatting to use, or in which cases you should prefix properties with $) and concentrate on data that you want to analize.

Features

  • Supports full Mixpanel HTTP Tracking API
  • Send tracking messages synchronously or asynchronously, pack them into batches, create messages to send them later
  • Pass message data in form that you prefer: predifined contract, IDictionary<string, object>, anonymous type or dynamic
  • Add properties globally to all messages with super properties. Usable for properties such as distinct_id
  • Great configurability. For example you can provide your own JSON serializer or function that will make HTTP requests
  • No dependencies. Keeps your project clean
  • Runs on .NET 4.5 and .NET Standard 1.1
  • Good documentation

Sample usage for track message

var mc = new MixpanelClient("e3bc4100330c35722740fb8c6f5abddc");
await mc.TrackAsync("Level Complete", new {
    DistinctId = "12345",
    LevelNumber = 5,
    Duration = TimeSpan.FromMinutes(1)
});

This will send the following JSON to https://api.mixpanel.com/track/:

{
  "event": "Level Complete",
  "properties": {
    "token": "e3bc4100330c35722740fb8c6f5abddc",
    "distinct_id": "12345",
    "LevelNumber": 5,
    "$duration": 60
  }
}

Sample usage for profile message

var mc = new MixpanelClient("e3bc4100330c35722740fb8c6f5abddc");
await mc.PeopleSetAsync(new {
    DistinctId = "12345",   
    Name = "Darth Vader",    
    Kills = 215
});

This will send the following JSON to https://api.mixpanel.com/engage/:

{
    "$token": "e3bc4100330c35722740fb8c6f5abddc",
    "$distinct_id": "12345",    
    "$set": {       
        "$name": "Darth Vader",      
        "Kills": 215
    }
}

Copyright

Copyright © 2019 Aleksandr Ivanov

Licence

mixpanel-csharp is licensed under MIT. Refer to LICENSE for more information.

mixpanel-csharp's People

Contributors

dhritzkiv avatar eealeivan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.