customerio / customerio-ruby

A ruby client for the Customer.io event API.
https://customer.io/docs/api/
MIT License
64 stars 75 forks source link

Allow customer_id to be specified in identify URL #102

Closed jrbeck closed 7 months ago

jrbeck commented 1 year ago

This is a rebase of the work here:

https://github.com/trwalzer/customerio-ruby

The issue is here:

https://github.com/customerio/customerio-ruby/issues/78

I did nothing new, but I wanted to use the technique @trwazler added, but with a more recent version of the gem.

jeremyw commented 7 months ago

Can this be merged? We're running into this issue as well -- the API does what we need but the Ruby wrapper doesn't.

jrbeck commented 7 months ago

@jeremyw this is ready to be merged, just waiting for the review. @stephen-pope-customer-io can we get this reviewed?

stephen-pope-customer-io commented 7 months ago

You surely mean @hownowstephen , and not me here

jrbeck commented 7 months ago

@stephen-pope-customer-io, thank you!

richdawe-cio commented 7 months ago

@jrbeck @jeremyw Thanks for your changes and the PR.

I implemented a slightly different approach to the one in this PR, which was to make the identify automatically use the cio_id attributed as the customer ID. You can see the PR that I merged, and an example usage at https://github.com/customerio/customerio-ruby/pull/109

I've published version 5.2.0 of the library in Ruby Gems. I'm happy to revisit it if it's not doing what you need. Could you take a look at this approach and the new library version, and let me know your thoughts, please?

jeremyw commented 7 months ago

@richdawe-cio I don't think that change solves this problem.

We need to be able to pass email as the identifier in the path, and the id in the body.

To be clear: we aren't trying to update the email address on a person. We're trying to identify users a second time using the same email address without having to know their cio_id, when they have a new unique id due to be unique website visitors.

richdawe-cio commented 7 months ago

@richdawe-cio I don't think that change solves this problem.

We need to be able to pass email as the identifier in the path, and the id in the body.

Thanks for the quick feedback, and clarifying @jeremyw , I appreciate it . That wasn't clear from the original issue or the code changes in this PR. I'll add that feature in too.

I think you may have a different use-case to the original issue. Thanks for helping me understand your use-case.

richdawe-cio commented 7 months ago

Thanks for opening this PR. In the end, we implemented this in a slightly different way in https://github.com/customerio/customerio-ruby/pull/111 , by adding a customer_id parameter to the identify method. E.g.:

$customerio.identify(
  :customer_id => "bob@example.com",
  :location => "Australia"
)

Thank you for opening this PR, the discussions on it, and the help resolving this issue with the Ruby client library.

I don't think this PR is needed any longer, so I'm going to close it.