PHPackages                             engageso/engage-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. engageso/engage-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

engageso/engage-php
===================

A PHP SDK for Engage (http://engage.so/)

1.2.0(2y ago)33.8k4MITPHP

Since Feb 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/engage-so/engage-php)[ Packagist](https://packagist.org/packages/engageso/engage-php)[ Docs](https://engage.so/)[ RSS](/packages/engageso-engage-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

Engage PHP SDK
==============

[](#engage-php-sdk)

The Engage PHP SDK lets you capture user attributes and events on your site. You can later use this on Engage to create user segments for analytics, broadcast messages and automation messages.

Getting Started
---------------

[](#getting-started)

[Create an Engage account](https://engage.so/) to get your API key

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

[](#installation)

```
composer require "engageso/engage-php"

```

Configuration
-------------

[](#configuration)

Initialise the SDK with your public and private key. Your keys are available in the settings page of your Engage dashboard.

```
$engage = new \Engage\EngageClient($_SERVER['pub_key'], $_SERVER['pri_key']);
```

Identifying users
-----------------

[](#identifying-users)

You only need a unique identifier that represents the user on your platform to track their events and attributes on Engage. To correlate a proper profile to these tracked attributes and events, you can send the unique identifier and other properties to Engage. You only need to do this once per user, probably at user signup.

```
$engage->users->identify([
  'id' => 'u13345',
  'email' => 'dan@mail.app',
  'created_at' => '2020-05-30T09:30:10Z'
]);
```

`id` represents the unique identifier for the user on your platform. It is the only required parameter. You can send any other attribute you want e.g. `age`, `plan`. Here are the standard ones we use internally on the user profile:

- `first_name`
- `last_name`
- `email`
- `is_account` (if the user is an account or customer)
- `number` (with international dialing code without the +)
- `created_at` (represents when the user registered on your platform. If not added, Engage sets it to the current timestamp.)

To identify a user as an [Account](https://docs.engage.so/en-us/a/638b651db6bd27a330786c09-accounts):

```
$engage->users->identify([
  'id' => 'u13345',
  'is_account' => true,
  'email' => 'hello@mail.app',
  'created_at' => '2020-05-30T09:30:10Z'
]);
```

To convert a Customer to an Account:

```
$engage->users->convertToAccount('u13345');
```

To convert an Account to a Customer:

```
$engage->users->convertToCustomer('u15645');
```

Update/add user attributes
--------------------------

[](#updateadd-user-attributes)

If you need to add new attributes or update an existing attribute, you can use the `addAttribute` method.

```
$engage->users->addAttribute($userId, [
  'first_name' => 'Dan',
  'plan' => 'Premium'
]);
```

(You can also use `identify` to update or add new attributes.)

Tracking user events and actions
--------------------------------

[](#tracking-user-events-and-actions)

You can track user events and actions in a couple of ways.

Tracking an event with no value:

```
$engage->users->track($userId, 'Delinquent');
```

Tracking an event with a value:

```
$engage->users->track($userId, [
  'event' => 'New badge',
  'value' => 'gold',
  'timestamp' => '2020-05-30T09:30:10Z'
]);
```

`event` is the event you want to track. `value` is the value of the event. This can be a string, number or boolean. There is an optional `timestamp` parameter. If not included, Engage uses the current timestamp. The timestamp value must be a valid datetime string.

If you need to track more properties with the event, you can track it this way:

```
$engage->users->track($userId, [
  'event' => 'Add to cart',
  'properties' => [
    'product' => 'T123',
    'currency' => 'USD',
    'amount' => 12.99
  ]
]);
```

Add a Customer to an Account
----------------------------

[](#add-a-customer-to-an-account)

```
$engage->users->addToAccount($userId, $accountId, $role);
```

Role is optional.

Update Account role
-------------------

[](#update-account-role)

```
$engage->users->changeAccountRole($userId, $accountId, $newRole);
```

Remove Customer from Account
----------------------------

[](#remove-customer-from-account)

```
$engage->users->removeFromAccount($userId, $accountId);
```

License
-------

[](#license)

MIT

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.2% of commits — single point of failure

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 ~175 days

Recently: every ~164 days

Total

6

Last Release

992d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/90e81cb444bd089e99e67624873a932b989c5fbefbc2e23320121011e1e66fe2?d=identicon)[kehers](/maintainers/kehers)

---

Top Contributors

[![kehers](https://avatars.githubusercontent.com/u/213649?v=4)](https://github.com/kehers "kehers (13 commits)")[![codehakase](https://avatars.githubusercontent.com/u/9336187?v=4)](https://github.com/codehakase "codehakase (4 commits)")[![afolabiabass](https://avatars.githubusercontent.com/u/11009095?v=4)](https://github.com/afolabiabass "afolabiabass (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/engageso-engage-php/health.svg)

```
[![Health](https://phpackages.com/badges/engageso-engage-php/health.svg)](https://phpackages.com/packages/engageso-engage-php)
```

###  Alternatives

[internal/dload

Downloads binaries.

98142.7k10](/packages/internal-dload)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[pixelopen/cloudflare-turnstile-bundle

A simple package to help integrate Cloudflare Turnstile on Symfony.

31205.8k3](/packages/pixelopen-cloudflare-turnstile-bundle)

PHPackages © 2026

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