customerio v0.1.2 Customerio
Main module to interact with API.
Link to this section Summary
Functions
Track anonymous events directly without customer ID
Track anonymous events directly without customer ID
Delete customers
Delete customers
Creating or updating customers
Creating or updating customers
Track the event for given customer
Track the event for given customer
Track page view event directly with customer ID
Track page view event directly with customer ID
Link to this section Types
Link to this section Functions
anonymous_track(name :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: {:ok, Customerio.Success.t} | {:error, Customerio.Error.t}
Track anonymous events directly without customer ID.
Params
name
- the name of the event to track.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.anonymous_track("purchase", %{recipient: "success@example.com"})
{:ok, %Customerio.Success{}}
iex> Customerio.anonymous_track("purchase", %{recipient: "fail@example.com"})
{:error, %Customerio.Error{}}
anonymous_track!(name :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: Customerio.Success.t
Track anonymous events directly without customer ID.
Raises Customerio.Error
if fails.
Params
name
- the name of the event to track.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.anonymous_track!("purchase", %{recipient: "success@example.com"})
%Customerio.Success{}
iex> Customerio.anonymous_track!("purchase", %{recipient: "fail@example.com"})
** (Customerio.Error) "Epic fail!"
delete(id :: value, opts :: [{:key, value}]) :: {:ok, Customerio.Success.t} | {:error, Customerio.Error.t}
Delete customers.
Params
id
- the unique identifier for the customer.opts
- HTTPoison options.
Example
iex> Customerio.delete(5)
{:ok, %Customerio.Success{}}
iex> Customerio.delete(6)
{:error, %Customerio.Error{}}
delete!(id :: value, opts :: [{:key, value}]) :: Customerio.Success.t
Delete customers.
Raises Customerio.Error
if fails.
Params
id
- the unique identifier for the customer.opts
- HTTPoison options.
Example
iex> Customerio.delete!(5)
%Customerio.Success{}
iex> Customerio.delete!(6)
** (Customerio.Error) "Epic fail!"
identify(id :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: {:ok, Customerio.Success.t} | {:error, Customerio.Error.t}
Creating or updating customers.
Params
id
- the unique identifier for the customer.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.identify(5, %{email: "success@example.com"})
{:ok, %Customerio.Success{}}
iex> Customerio.identify(6, %{email: "fail@example.com"})
{:error, %Customerio.Error{}}
identify!(id :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: Customerio.Success.t
Creating or updating customers.
Raises Customerio.Error
if fails.
Params
id
- the unique identifier for the customer.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.identify!(5, %{email: "success@example.com"})
%Customerio.Success{}
iex> Customerio.identify!(6, %{email: "fail@example.com"})
** (Customerio.Error) "Epic fail!"
track(id :: value, name :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: {:ok, Customerio.Success.t} | {:error, Customerio.Error.t}
Track the event for given customer.
Params
id
- the unique identifier for the customer.name
- the name of the event to track.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.track(5, "purchase", %{price: 23,45})
{:ok, %Customerio.Success{}}
iex> Customerio.track(6, "crash", %{reason: "epic fail"})
{:error, %Customerio.Error{}}
track!(id :: value, name :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: Customerio.Success.t
Track the event for given customer.
Raises Customerio.Error
if fails.
Params
id
- the unique identifier for the customer.name
- the name of the event to track.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.track!(5, "purchase", %{price: 23,45})
%Customerio.Success{}
iex> Customerio.track!(6, "crash", %{reason: "epic fail"})
** (Customerio.Error) "Epic fail!"
track_page_view(id :: value, page_name :: String.t, data_map :: %{key: value}, opts :: [{:key, value}]) :: {:ok, Customerio.Success.t} | {:error, Customerio.Error.t}
Track page view event directly with customer ID.
Params
id
- the unique identifier for the customer.page_name
- the URL of the page.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.track_page_view(5, "http://google.com", %{ref: "success"})
{:ok, %Customerio.Success{}}
iex> Customerio.track_page_view(5, "http://google.com", %{ref: "fail"})
{:error, %Customerio.Error{}}
track_page_view!(id :: value, page_name :: value, data_map :: %{key: value}, opts :: [{:key, value}]) :: Customerio.Success.t | {:error, Customerio.Error.t}
Track page view event directly with customer ID.
Raises Customerio.Error
if fails.
Params
id
- the unique identifier for the customer.page_name
- the URL of the page.data_map
- custom attributes to define the customer.opts
- HTTPoison options.
Example
iex> Customerio.track_page_view!(5, "http://google.com", %{ref: "success"})
%Customerio.Success{}
iex> Customerio.track_page_view!(5, "http://google.com", %{ref: "fail"})
** (Customerio.Error) "Epic fail!"