PHPackages                             gosquared/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gosquared/php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gosquared/php-sdk
=================

3.0.2(7y ago)1023.3k↓33.3%4[1 issues](https://github.com/gosquared/php-sdk/issues)MITPHP

Since Apr 28Pushed 5y ago7 watchersCompare

[ Source](https://github.com/gosquared/php-sdk)[ Packagist](https://packagist.org/packages/gosquared/php-sdk)[ Docs](https://github.com/gosquared/php-sdk)[ RSS](/packages/gosquared-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

GoSquared PHP SDK
=================

[](#gosquared-php-sdk)

The official GoSquared PHP module for integrating the [GoSquared API](https://gosquared.com/docs) into your PHP app with ease.

Installation
------------

[](#installation)

Available on [packagist](https://packagist.org/packages/gosquared/php-sdk)

Usage
-----

[](#usage)

### Tracking API

[](#tracking-api)

See the [Tracking API](https://gosquared.com/docs/tracking/api/) docs site for full documentation.

### Reporting API

[](#reporting-api)

The reporting APIs and their functions are listed on [Reporting API](https://www.gosquared.com/developer/api/) docs site.

Quick guide
-----------

[](#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
------------

[](#requirements)

- PHP &gt;= 5.2.0
- cURL

Running tests
-------------

[](#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
---------

[](#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.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 68.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~448 days

Total

4

Last Release

2691d ago

Major Versions

v2.0.0 → 3.0.02015-07-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/e927125ec1142102072a5c593d379eb8229bdd133c31e24a79781b5c35feff4d?d=identicon)[TheDeveloper](/maintainers/TheDeveloper)

![](https://avatars.githubusercontent.com/u/1298873?v=4)[GoSquared](/maintainers/gosquared)[@gosquared](https://github.com/gosquared)

---

Top Contributors

[![TheDeveloper](https://avatars.githubusercontent.com/u/432425?v=4)](https://github.com/TheDeveloper "TheDeveloper (22 commits)")[![simontabor](https://avatars.githubusercontent.com/u/1441031?v=4)](https://github.com/simontabor "simontabor (9 commits)")[![russellvaughan](https://avatars.githubusercontent.com/u/16154072?v=4)](https://github.com/russellvaughan "russellvaughan (1 commits)")

---

Tags

eventtrackinganalyticscustomer

### Embed Badge

![Health badge](/badges/gosquared-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/gosquared-php-sdk/health.svg)](https://phpackages.com/packages/gosquared-php-sdk)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

1.6k141.6M184](/packages/league-event)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[cornford/googlitics

An easy way to integrate Google Analytics with Laravel.

3310.2k](/packages/cornford-googlitics)[axllent/silverstripe-analytics-js

Google Universal Analytics tracking code for Silverstripe

1721.3k](/packages/axllent-silverstripe-analytics-js)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
