定制 gosquared/php-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

gosquared/php-sdk

最新稳定版本:3.0.2

Composer 安装命令:

composer require gosquared/php-sdk

包简介

README 文档

README

The official GoSquared PHP module for integrating the GoSquared API into your PHP app with ease.

Installation

Available on packagist

Usage

Tracking API

See the Tracking API docs site for full documentation.

Reporting API

The reporting APIs and their functions are listed on Reporting API docs site.

Quick guide

require_once('gosquared-php-sdk/main.php');

$opts = array(
  'site_token' => 'your-site-token',
  'api_key' => 'your-api-key'
);
$GS = new GoSquared($opts);

// Track events
$result = $GS->track_event('Event Name');

// Create anonymous Person
$person = $GS->create_person();

// Identify person
$response = $person->identify(array(
  'id' => 'user-id',
  'name' => 'Foo Bar',
  'email' => 'foo@bar.com'
));

// Retrieve live data
$result = $GS->now->concurrents();

// Retrieve historical trends and ecommerce data
$result = $GS->trends->aggregate();

Requirements

  • PHP >= 5.2.0
  • cURL

Running tests

make test

To test with your own site token and api key, you can prefix this command with the SITE_TOKEN and API_KEY environment variables containing your keys. WARNING: this will track test data under your account

Debugging

To switch on debug logs, place the following define statement before including this library:

define('GOSQUARED_DEBUG', true);

Debug output will then be sent to the standard output streams. Common places to find the output are your console (if run with CLI), your web server logs, or php-fpm logs.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 7
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-28