2017 © Pedro Peláez
 

library infinario

Infinario PHP SDK

image

infinario/infinario

Infinario PHP SDK

  • Tuesday, March 15, 2016
  • by ms7s
  • Repository
  • 9 Watchers
  • 1 Stars
  • 16,456 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Infinario PHP SDK

, (*1)

The \Infinario\Infinario class provides access to the Infinario PHP tracking API. The SDK requires PHP >= 5.3.2 and php5-curl., (*2)

Installation

Install the latest version with Composer:, (*3)

composer require infinario/infinario

Getting started

In order to track events, instantiate the class at least with your project token (can be found in Project Management in your Infinario account), for example:, (*4)

use Infinario\Infinario;

$infinario = new Infinario('12345678-90ab-cdef-1234-567890abcdef');                       // PRODUCTION ENVIRONMENT
// $infinario = new Infinario('12345678-90ab-cdef-1234-567890abcdef', ['debug' => true]); // DEVELOPMENT ENVIRONMENT

You can also provide a PSR-3 compliant logger interface:, (*5)

$infinario = new Infinario('12345678-90ab-cdef-1234-567890abcdef', ['logger' => $logger]);

Timeout for sending data is set to 1000ms you can overwrite it by following option:, (*6)

$infinario = new Infinario('12345678-90ab-cdef-1234-567890abcdef', ['timeout' => 500]);

Identifying the customer

When tracking events, you have to specify which customer generated them. This can be either done right when calling the client's constructor., (*7)

use Infinario\Infinario;

$infinario = new Infinario('12345678-90ab-cdef-1234-567890abcdef', ['customer' => 'john123']);

or by calling identify., (*8)

$infinario->identify('john123');

Tracking events

To track events for the currently selected customer, simply call the track method., (*9)

$infinario->track('purchase');

You can also specify an array of event properties to store with the event., (*10)

$infinario->track('purchase', ['product' => 'bottle', 'amount' => 5]);

Updating customer properties

You can also update information that is stored with a customer., (*11)

$infinario->update(['first_name' => 'John', 'last_name' => 'Smith']);

The Versions

15/03 2016

dev-master

9999999-dev https://github.com/infinario/php-sdk

Infinario PHP SDK

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

analytics events tracking player analytics

01/12 2015

v1.1.0

1.1.0.0 https://github.com/infinario/php-sdk

Infinario PHP SDK

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

analytics events tracking player analytics

10/04 2015

v1.0.1

1.0.1.0 https://github.com/infinario/php-sdk

Infinario PHP SDK

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

analytics events tracking player analytics

10/04 2015

v1.0.0

1.0.0.0 https://github.com/infinario/php-sdk

Infinario PHP SDK

  Sources   Download

Apache-2.0

The Requires

  • ext-curl *

 

The Development Requires

analytics events tracking player analytics