Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Customerio Bundle Laravel Package

dubture/customerio-bundle

View on GitHub
Deep Wiki
Context7

customer.io bundle

Build Status Scrutinizer Code Quality

Latest Stable Version Total Downloads License

Symfony integration for http://customer.io.

Configuration

Install the bundle using composer and register it in your Kernel.

Then configure your site_id and api_key:

# app/config/config.yml

dubture_customer_io:
  site_id: <YOUR-SITE-ID>
  api_key: <YOUR-API-KEY>

Usage

Customer model

Implement Dubture\CustomerIOBundle\Model\CustomerInterface on your customer domain class.

Event Tracking / Customer identification


use Dubture\CustomerIOBundle\Event\TrackingEvent;
use Dubture\CustomerIOBundle\Event\ActionEvent;

/** @var \Symfony\Component\EventDispatcher\EventDispatcher $tracker */
$dispatcher = $this->getContainer()->get('event_dispatcher');

$customer = $someRepo->getCustomer(); // retrieve your customer domain object

// send the customer over to customer.io for identification
$dispatcher->dispatch(TrackingEvent::IDENTIFY, new TrackingEvent($customer));

// now track a `click` event
$dispatcher->dispatch(TrackingEvent::ACTION, new ActionEvent($customer, 'click'));

Webhooks

The bundle comes with a controller which can consume customer.io webhooks.

To use them, register the routing.xml:

# app/config/routing.yml

customerio_hooks:
    resource: "@DubtureCustomerIOBundle/Resources/config/routing.xml"

Now your hook url will be http://your.project.com//__dubture/customerio which you need to configure over at customer.io.

After doing so, you can listen to webhook events:


<service id="acme.webhooklistener" class="Acme\DemoBundle\Listener\WebhookListener">
    <tag name="kernel.event_listener" event="customerio.email_clicked" method="onClick" />
</service>


use Dubture\CustomerIOBundle\Event\WebHookEvent;

class WebhookListener
{
    public function onClick(WebHookEvent $event)
    {
        $this->logger->info('Customer clicked on email with address: '
        . $event->getEmail());
    }
}

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware