PHPackages                             aitor/analytics-php - 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. aitor/analytics-php

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

aitor/analytics-php
===================

Segment Analytics PHP Library

2.0.0(4y ago)05MITPHPPHP &gt;=7.4

Since Feb 11Pushed 4y agoCompare

[ Source](https://github.com/aitor72/analytics-php)[ Packagist](https://packagist.org/packages/aitor/analytics-php)[ Docs](https://segment.com/libraries/php)[ RSS](/packages/aitor-analytics-php/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (66)Used By (0)

analytics-php
=============

[](#analytics-php)

[![Segmentio](https://camo.githubusercontent.com/6ad1764f22d2f74d92daa993212ad4f5aa3a34dc53621fee2cb9a8ccf1bbd177/68747470733a2f2f636972636c6563692e636f6d2f67682f7365676d656e74696f2f616e616c79746963732d7068702e7376673f7374796c653d736869656c6426636972636c652d746f6b656e3d61323061346231646161383635643136346536326361353961363564363735336432383663316331)](https://app.circleci.com/pipelines/github/segmentio/analytics-php)

analytics-php is a php client for [Segment](https://segment.com)

 [![](https://user-images.githubusercontent.com/16131737/53616825-4bd81c00-3b99-11e9-819a-f5fdf527d3c4.png)](https://user-images.githubusercontent.com/16131737/53616825-4bd81c00-3b99-11e9-819a-f5fdf527d3c4.png)***You can't fix what you can't measure***

Analytics helps you measure your users, product, and business. It unlocks insights into your app's funnel, core business metrics, and whether you have product-market fit.

How to get started
------------------

[](#how-to-get-started)

1. **Collect analytics data** from your app(s).
    - The top 200 Segment companies collect data from 5+ source types (web, mobile, server, CRM, etc.).
2. **Send the data to analytics tools** (for example, Google Analytics, Amplitude, Mixpanel).
    - Over 250+ Segment companies send data to eight categories of destinations such as analytics tools, warehouses, email marketing and remarketing systems, session recording, and more.
3. **Explore your data** by creating metrics (for example, new signups, retention cohorts, and revenue generation).
    - The best Segment companies use retention cohorts to measure product market fit. Netflix has 70% paid retention after 12 months, 30% after 7 years.

[Segment](https://segment.com) collects analytics data and allows you to send it to more than 250 apps (such as Google Analytics, Mixpanel, Optimizely, Facebook Ads, Slack, Sentry) just by flipping a switch. You only need one Segment code snippet, and you can turn integrations on and off at will, with no additional code. [Sign up with Segment today](https://app.segment.com/signup).

### Why?

[](#why)

1. **Power all your analytics apps with the same data**. Instead of writing code to integrate all of your tools individually, send data to Segment, once.
2. **Install tracking for the last time**. We're the last integration you'll ever need to write. You only need to instrument Segment once. Reduce all of your tracking code and advertising tags into a single set of API calls.
3. **Send data from anywhere**. Send Segment data from any device, and we'll transform and send it on to any tool.
4. **Query your data in SQL**. Slice, dice, and analyze your data in detail with Segment SQL. We'll transform and load your customer behavioral data directly from your apps into Amazon Redshift, Google BigQuery, or Postgres. Save weeks of engineering time by not having to invent your own data warehouse and ETL pipeline.

    For example, you can capture data on any app:

    ```
    analytics.track('Order Completed', { price: 99.84 })
    ```

    Then, query the resulting data in SQL:

    ```
    select * from app.order_completed
    order by price desc
    ```

### 🚀 Startup Program

[](#-startup-program)

 [![](https://user-images.githubusercontent.com/16131737/53128952-08d3d400-351b-11e9-9730-7da35adda781.png)](https://segment.com/startups)

If you are part of a new startup (&lt;$5M raised, &lt;2 years since founding), we just launched a new startup program for you. You can get a Segment Team plan (up to **$25,000 value** in Segment credits) for free up to 2 years — [apply here](https://segment.com/startups/)! Documentation
-------------

[](#documentation)

Documentation is available at [segment.com/docs/sources/server/php](https://segment.com/docs/sources/server/php/)

Releasing
---------

[](#releasing)

Run `make release VERSION=`. It should automatically tag and release in composer

License
-------

[](#license)

```
WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|

```

(The MIT License)

Copyright (c) 2014 Segment Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor4

4 contributors hold 50%+ of commits

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 ~75 days

Recently: every ~293 days

Total

42

Last Release

1813d ago

Major Versions

0.4.8 → v1.x-dev2014-06-17

1.8.0 → 2.0.02021-07-16

PHP version history (3 changes)0.2.2PHP &gt;=5.3

1.1.1PHP &gt;=5.3.3

2.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dfce2172e60757e32b773a7b3c5035be317553815fdc683ac39847fba753a81?d=identicon)[aitor72](/maintainers/aitor72)

---

Top Contributors

[![nd4p90x](https://avatars.githubusercontent.com/u/2658588?v=4)](https://github.com/nd4p90x "nd4p90x (87 commits)")[![yields](https://avatars.githubusercontent.com/u/1661587?v=4)](https://github.com/yields "yields (31 commits)")[![dailycoding](https://avatars.githubusercontent.com/u/13878119?v=4)](https://github.com/dailycoding "dailycoding (30 commits)")[![f2prateek](https://avatars.githubusercontent.com/u/843979?v=4)](https://github.com/f2prateek "f2prateek (29 commits)")[![calvinfo](https://avatars.githubusercontent.com/u/487539?v=4)](https://github.com/calvinfo "calvinfo (22 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (21 commits)")[![lubird](https://avatars.githubusercontent.com/u/7109746?v=4)](https://github.com/lubird "lubird (18 commits)")[![pooyaj](https://avatars.githubusercontent.com/u/2992515?v=4)](https://github.com/pooyaj "pooyaj (15 commits)")[![brennan](https://avatars.githubusercontent.com/u/11224497?v=4)](https://github.com/brennan "brennan (9 commits)")[![dominicbarnes](https://avatars.githubusercontent.com/u/160197?v=4)](https://github.com/dominicbarnes "dominicbarnes (8 commits)")[![MindfullyLoko](https://avatars.githubusercontent.com/u/59059891?v=4)](https://github.com/MindfullyLoko "MindfullyLoko (5 commits)")[![Cethy](https://avatars.githubusercontent.com/u/735030?v=4)](https://github.com/Cethy "Cethy (3 commits)")[![kzap](https://avatars.githubusercontent.com/u/62213?v=4)](https://github.com/kzap "kzap (3 commits)")[![Robertbaelde](https://avatars.githubusercontent.com/u/4356288?v=4)](https://github.com/Robertbaelde "Robertbaelde (2 commits)")[![inaniyants](https://avatars.githubusercontent.com/u/4038277?v=4)](https://github.com/inaniyants "inaniyants (2 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (2 commits)")[![zoohavenly](https://avatars.githubusercontent.com/u/82112492?v=4)](https://github.com/zoohavenly "zoohavenly (1 commits)")[![e1himself](https://avatars.githubusercontent.com/u/370680?v=4)](https://github.com/e1himself "e1himself (1 commits)")[![gnat](https://avatars.githubusercontent.com/u/24665?v=4)](https://github.com/gnat "gnat (1 commits)")[![Gufran](https://avatars.githubusercontent.com/u/2152267?v=4)](https://github.com/Gufran "Gufran (1 commits)")

---

Tags

analyticssegmentioanalytics.jssegment

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/aitor-analytics-php/health.svg)

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

###  Alternatives

[segmentio/analytics-php

Segment Analytics PHP Library

26622.7M32](/packages/segmentio-analytics-php)[spatie/laravel-analytics

A Laravel package to retrieve Google Analytics data.

3.3k6.1M68](/packages/spatie-laravel-analytics)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)[panphp/pan

A simple, lightweight, and privacy-focused product analytics php package.

1.3k111.1k5](/packages/panphp-pan)[zumba/amplitude-php

PHP SDK for Amplitude

4110.3M5](/packages/zumba-amplitude-php)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

211189.7k8](/packages/bezhansalleh-filament-google-analytics)

PHPackages © 2026

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