Skip to content

The hassle-free way to integrate analytics into any php application.

License

Notifications You must be signed in to change notification settings

castledio/castled-php-sdk

 
 

Repository files navigation

The Castled PHP SDK empowers your PHP-based backend servers to transmit user attributes and events to Castled. This data can serve as triggers for campaigns or workflows, or be synchronized with your data warehouse for advanced customer segmentation. The following steps will guide you through the process of integrating the SDK with your PHP application.

SDK Installation

require_once __DIR__ . '/vendor/autoload.php';

composer require castledio/castled-php-sdk

SDK Initialisation

  Castled::init(<Your API Key>);

Track User Attributes

  Castled::identify([
        'userId' => '12345',
        'traits' => [
            'plan' => 'basic',
            'first_name' => 'John',
            'last_name' => 'Taylor'
        ]
    ]);

Track User Events

  Castled::track([
        'event' => 'order_status_update',
        'userId' => '12345',
        'properties' => [
            'plan' => 'basic',
            'order_id' => 'o1'
        ]
    ]);

About

The hassle-free way to integrate analytics into any php application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 97.8%
  • Makefile 1.3%
  • Shell 0.9%