NAME

WebService::Async::CustomerIO::Customer - Class for working with customer.

SYNOPSIS

DESCRIPTION

new

Creates customer object. This method just creates an object, to sent this data to api, after creation should be called upsert method.

Usage: new(%params) -> obj

parameters:

  • id - the unique identifier for the customer.

  • email - optional. the email address of the user.

  • created_at - optional. the unix timestamp from when the user was created in your system

  • attributes - hashref which contains custom attributes to define the customer.

api

id

email

created_at

attributes

upsert

Create or update a customer

Usage: upsert() -> Future()

set_attribute

Set a customer attribute

Usage: set_attribute($name, $value) -> Future()

remove_attribute

Remove customer attribute

Usage: remove_attribute($name, $value) -> Future()

suppress

Suppress the customer. All events related to this customer wil be ignored by API.

Usage: suppress() -> Future()

unsuppress

Unsuppress the customer.

Usage: unsuppress() -> Future()

upsert_device

Create or update a customer device

Usage: upsert_device(%params) -> Future()

Parameters:

  • id - The unique token for the user device.

  • platform - The platform for the user device. Allowed values are 'ios' and 'android'.

  • last_used - Optional. UNIX timestamp representing the last used time for the device. If this is not included we default to the time of the device identify.

delete_device

Delete a customer device

Usage: delete_device($id) -> Future()

emit_event

Track a customer event

Usage: emit_event(%params) -> Future()

Parameters:

- name: The name of the event to track - type: Optional. Used to change event type. For Page View events set to "page". - data: Optional. Custom data to include with the event.

delete_customer

Delete a customer

Usage: delete_customer() -> Future()