userscape/customerio

Customer.io的PHP API

2.1.1 2021-01-22 19:23 UTC

This package is not auto-updated.

Last update: 2024-09-20 22:43:18 UTC


README

PHP API与Customer.io集成

"足够好了!"

Build Status

使用方法

$api = new Customerio\Api($siteId, $apiSecret, new Customerio\Request);

$response = $api->createCustomer(
    'someid001',
    'some@email.com',
    array('arbitrary-data' => 'foobarbaz')
);

if ($response->success()) {
    // Continue on with life
} else {
    // Learn from your mistakes
    echo $response->message();
}

API方法

创建客户

createCustomer('someid001', 'some@email.com', array('arbitrary-data' => 'foobarbaz'));

更新客户

updateCustomer('someid001', 'some@email.com', array('arbitrary-data' => 'foobarbaz'));

删除客户

deleteCustomer('someid001');

触发事件

fireEvent('someid001', 'event-name', array('arbitrary-value' => 3.14));

触发历史事件

fireEvent('someid001', 'event-name', array('arbitrary-value' => 3.14), 1420070400);

触发匿名事件:(http://customer.io/docs/invitation-emails.html)

fireAnonymousEvent('event-name', array('arbitrary-value' => 3.14));

记录页面浏览

recordPageview('someid001', 'https://www.full-pageview-url.com/', 'https://www.optional-full-referrer-url.com/');

响应对象

所有方法都返回一个包含以下方法的Response对象:

success() // Boolean

message() // String