Code Monkey home page Code Monkey logo

customeriosharp's People

Contributors

francisrath avatar saxondruce avatar southcentralcode avatar vegardlarsen avatar zimmpatrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

customeriosharp's Issues

Strongly typed "LINQ to Customer.io" implementation for API broadcasts

await _customerIo.Campaign(17)
    .Where(broadcast => broadcast.InSegment(23))
    .Where(broadcast => broadcast.Customer.Interest == "roadrunners")
    .TriggerAsync(new { data = "foo" });

This would give us type safety (we already know what all the customer attributes are, but it would require adding a generic type argument to our entire class).

Everything in the API syntax, should be possible to implement using expression trees, but this may turn out to be a lot more work than required.

See:

Appears Successful, CustomerIO not receiving events

Hello,

I'm trying to get CustomerIOSharp working within Unity 2018.1.9f2. I'm using Unity's .NET 4.x support, so everything should be working just fine. My code appears to be calling into the API correctly, but for some reason CustomerIO is not receiving either the events or the user property update. I am not catching any exceptions (though I'm fairly new to async in C# and may be making a mistake). Is there's something I'm missing here?

I've done some simple curl calls with my siteId and apiKey for sanity, and those work fine.

My wrapper looks like this:

public CustomerIOWrapper()
{
    _customerIo = new CustomerIo(_siteId, _apiKey);
}

public Task UpdateUser(IAnalyticsEventReport report)
{
    try
    {
        return _customerIo.IdentifyAsync(report.Dossier.ToCustomer());
    }
    catch (CustomerIoApiException e)
    {
        Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message);
        return new Task(() => Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message));
    }
}

private Task TrackEventAsync(string customerId, string eventName, IDictionary<string, object> data)
{
    Dbg.LogFormat("#customerio #analytics CustomerIO customerId: {0}", customerId);
    try
    {
        return _customerIo.TrackEventAsync(eventName, data, customerId: customerId);
    }
    catch (CustomerIoApiException e)
    {
        Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message);
        return new Task(() => Dbg.WarningFormat("#customerio HTTP Response: {0}, Reason: {1}", e.HResult, e.Message));
    }
}

Am I missing something stupid here?

Is there a better way I can log out the results from the HTTP call?

HttpClient Socket Exhaustion

A new instance of HttpClient is created with every CustomerIO instance. I am concerned on HttpClient Socket Exhaustion. Do you have any opinion on this, please?

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.