I've developed this library because the official Vero library is out of data and doesn't support some stuff.
- PHP 7.1+
- json extension
Install this library with composer by running the following command.
composer require samlittler/vero-php
- Users
- Identify
- Unsubscribe
- Resubscribe
- Delete
- Tags
- Add
- Remove
- Events
- Track
$vero = new \SamLittler\Vero('<your_auth_token>');
Standard Identify Usage
Standard identification usage is simple, and it allows subsequent track events to be collected on the Vero dashboard.
$user = $vero->users()->findOrCreate(123);
$user->identify();
You can also add arbitrary identification information here.
Note: Email addresses have a dedicated method, because they're handled differently.
$user = $vero->users()->findOrCreate(123);
$user->setEmail('john@example.com');
$user->identify([
'forename' => 'John',
'surname' => 'Smith',
]);
Push Channels
You can only register push channels during the identify call.
$user = $vero->users()->findOrCreate(123);
$user->addChannel('push', '<apns_or_fcm_token>', 'ios');
$user->identify();
You can programmatically unsubscribe users from Vero marketing.
$user = $vero->users()->findOrCreate(123);
$user->unsubscribe();
You can programmatically resubscribe users to Vero marketing.
$user = $vero->users()->findOrCreate(123);
$user->unsubscribe();
You can delete users from Vero. You'll require a new identify call to re-add them.
$user = $vero->users()->findOrCreate(123);
$user->delete();
$user = $vero->users()->findOrCreate(123);
$user->addTag('november');
$user = $vero->users()->findOrCreate(123);
$user->removeTag('november');
You can send track events with arbitrary data.
$user = $vero->users()->findOrCreate(123);
$user->track('User Registered', [
'referral' => 'app_store',
]);