承接 cossou/trak-io-api-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cossou/trak-io-api-client

Composer 安装命令:

composer require cossou/trak-io-api-client

包简介

PHP Trak.io Api Client built on Guzzle

README 文档

README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Installation

Install via Composer:

{
    "require": {
        "cossou/trak-io-api-client": "1.0.*"
    }
}

Methods available

  • identify
  • alias
  • track
  • annotate
  • distinct_id
  • channel

Documentation: http://docs.trak.io/

Examples

Quick Identify example:

require_once 'vendor/autoload.php';

use Cossou\Trakio;

$trakio = Trakio::init('YOUR-API-TOKEN');

// or
// $trakio = Trakio::init('YOUR-API-TOKEN', array('distinct_id' => 123));

try {
    $response = $trakio->identify(array('distinct_id' => 123, 'properties' => array('name' => 'Hélder Duarte')));
    var_dump($response);
} catch(Exception $e) {
    echo $e->getMessage();
}

Laravel

Add to your app/config/app.php file and scroll down to your providers and add

'providers' => array(
    ...
    'Cossou\TrakioServiceProvider',
)

And the alias:

'aliases' => array(
	...
   	'Trakio'		  => 'Cossou\Facades\Trakio',

And finally you run php artisan config:publish cossou/trak-io-api-client and fill in your API key.

And that's it!

Quick Laravel Example

Route::get('/', function()
{
	$trak = new Trakio;

	try {
		$response = $trak::identify(array('distinct_id' => 123, 'properties' => array('name' => 'Hélder Duarte')));
		dd($response);
	} catch(Exception $e) {
		dd($e->getMessage());
	}	
}

License

MIT License

统计信息

  • 总下载量: 3.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-11