Skip to content

Instantly share code, notes, and snippets.

@begin29
Last active October 28, 2022 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save begin29/cc03de241c235b71bebbaf29027c2e4d to your computer and use it in GitHub Desktop.
Save begin29/cc03de241c235b71bebbaf29027c2e4d to your computer and use it in GitHub Desktop.
identify/create customer and trigger event on customer_io
def user_params(user)
{
id: user.cio_id,
first_name: user.first_name,
last_name: user.last_name,
email: user.email,
}
end
cio_client = Customerio::Client.new(ENV['CUSTOMER_IO_SITE_ID'], ENV['CUSTOMER_IO_API_KEY'])
res = cio_client.identify(user_params(User.new(email: 'trololo@gmail.com', first_name: 'Dr', last_name: 'FeelGood', cio_id: 'u-9999')))
cio_client.track('u-9999', 'test-trigger', {test_key: 'test'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment