PHPackages                             dominion-solutions/customerio - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dominion-solutions/customerio

ActiveLibrary[API Development](/categories/api)

dominion-solutions/customerio
=============================

A Laravel Integration Layer for CustomerIO

0.0.3(10mo ago)0108↓90%[3 PRs](https://github.com/dominion-solutions/customerio/pulls)MITPHPPHP ^8.3CI passing

Since Aug 19Pushed 4w agoCompare

[ Source](https://github.com/dominion-solutions/customerio)[ Packagist](https://packagist.org/packages/dominion-solutions/customerio)[ Docs](https://github.com/dominion-solutions/customerio)[ Fund](https://donate.stripe.com/dRm3cw0nM14A9vl8VO48004)[ GitHub Sponsors]()[ RSS](/packages/dominion-solutions-customerio/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (18)Versions (14)Used By (0)

A Laravel Integration Layer for CustomerIO
------------------------------------------

[](#a-laravel-integration-layer-for-customerio)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d74c8cc7c1e859c953d87ac55b7ffe53c5eaf3f6bc7eb3ea025a7f7db620e16d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f6d696e696f6e2d736f6c7574696f6e732f637573746f6d6572696f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominion-solutions/customerio)[![GitHub Tests Action Status](https://camo.githubusercontent.com/441b5f3fd556ecd91b2cc9512bb93d58c29335a3dad0e9a3a1fbb0068b87e916/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d696e696f6e2d736f6c7574696f6e732f637573746f6d6572696f2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/dominion-solutions/customerio/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/519fb313db76c26655fa60618b27e259ebe55f7df54573a05f00e6efc1b7e267/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f646f6d696e696f6e2d736f6c7574696f6e732f637573746f6d6572696f2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/dominion-solutions/customerio/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/4a4ad6ff1dfe7b544c8483685423f3c964930b7e6fcb0a30148e79c3a98c592f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f6d696e696f6e2d736f6c7574696f6e732f637573746f6d6572696f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dominion-solutions/customerio)

This package provides an integration layer with CustomerIO. You can track various events for both anonymous and identified visitors to your site via various means.

Table of Contents
-----------------

[](#table-of-contents)

- [A Laravel Integration Layer for CustomerIO](#a-laravel-integration-layer-for-customerio)
- [Table of Contents](#table-of-contents)
- [Support us](#support-us)
- [Installation](#installation)
- [Usage](#usage)
    - [Identifying an Anonymous User](#identifying-an-anonymous-user)
    - [Identifying a Known User](#identifying-a-known-user)
    - [Tracking Events for an Unknown User](#tracking-events-for-an-unknown-user)
    - [Tracking Events for a Known User](#tracking-events-for-a-known-user)
    - [Merging Users](#merging-users)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security Vulnerabilities](#security-vulnerabilities)
- [Credits](#credits)
- [License](#license)

Support us
----------

[](#support-us)

We invest a lot of resources into creating [best in class open source packages](https://dominion.solutions/open-source). You can support us by [buying one of our paid products](https://dominion.solutions/products).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dominion-solutions/customerio
```

You can publish the config file with:

```
php artisan vendor:publish --tag="customerio-config"
```

This is the contents of the published config file:

```
return [
    'api-key' => env('CUSTOMER_IO_API_KEY', 'NOT_SET'),
    'region' => env('CUSTOMER_IO_REGION', 'US'),
    'version' => env('CUSTOMER_IO_VERSION', 'v1'),
];
```

Usage
-----

[](#usage)

### Identifying an Anonymous User

[](#identifying-an-anonymous-user)

```
$anonymousUser = new CIOUser(
    anonymousId: $request->session()->getId(),
    additionalFields: [
        // Additional Fields
    ],
    traits: [
        // Traits here.
    ]
);
$result = DominionSolutions\CustomerIO\Facade\CustomerIO::upsertUser(
    $anonymousUser,
    // If you need to inject an API Key here
    apiKey: $apiKey
);
//Do something with your result.
```

### Identifying a Known User

[](#identifying-a-known-user)

```
    userId: $request->email,
    traits: [
        'email' => $request->email,
        //Add your traits here
    ]);
$result = DominionSolutions\CustomerIO\Facade\CustomerIO::upsertUser(
    $identifyUser,
    // If you need to inject an API Key here
    apiKey: $apiKey
);
//Do something with your result.
```

### Tracking Events for an Unknown User

[](#tracking-events-for-an-unknown-user)

```
$trackingEvent = new TrackingEvent(
    $request->session()->getId(),
    event: 'your-event-name',
    properties: [
        // Your Event's Properties
    ],
    additionalFields: [
        // Additional Fields
    ],
    context: [
        'active' => true,
        // More Context Fields
    ]);

$result = DominionSolutions\CustomerIO\Facade\CustomerIO::trackEvent(
    $trackingEvent,
    // If you need to inject an API Key here
    apiKey: $apiKey
);
//Do something with your result.
```

### Tracking Events for a Known User

[](#tracking-events-for-a-known-user)

```
$trackingEvent = new TrackingEvent(
    $request->email,
    event: 'your-event-name',
    properties: [
        // Your Event's Properties
    ],
    additionalFields: [
        // Additional Fields
    ],
    context: [
        'active' => true,
        // More Context Fields
    ]);

$result = DominionSolutions\CustomerIO\Facade\CustomerIO::trackEvent(
    $trackingEvent,
    // If you need to inject an API Key here
    apiKey: $apiKey
);
//Do something with your result.
```

### Merging Users

[](#merging-users)

```
$response = CustomerIO::mergeUsers(
    $previousId,
    $userId,
    //If you need to inject an API Key here.
    apiKey: $apiKey
);
// Do something with your response.
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Mark J. Horninger](https://github.com/spam-n-eggs)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance77

Regular maintenance activity

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

3

Last Release

305d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7a0a7cba6a7a446fcf83e9042d7e57bee231f30cc8498281d323759d5a6153e?d=identicon)[dominion-solutions-llc](/maintainers/dominion-solutions-llc)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (45 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (42 commits)")[![spam-n-eggs](https://avatars.githubusercontent.com/u/13180040?v=4)](https://github.com/spam-n-eggs "spam-n-eggs (17 commits)")

---

Tags

laraveltrackingCustomerio

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/dominion-solutions-customerio/health.svg)

```
[![Health](https://phpackages.com/badges/dominion-solutions-customerio/health.svg)](https://phpackages.com/packages/dominion-solutions-customerio)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M152](/packages/spatie-laravel-health)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k9.9M89](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
