PHPackages                             moosend/website-tracking - 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. moosend/website-tracking

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

moosend/website-tracking
========================

By installing the Moosend PHP Tracking library you are can track page views, product views, add to cart events and successful purchases. You can later use these details to segment your user base, run automations, check how successful your latest promo has been and how many conversions your landing page has led to.

1.12.67(2y ago)1020.9k↑17.6%61MITPHP

Since Jun 7Pushed 2y ago10 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (59)Used By (1)

 [![Build Status](https://camo.githubusercontent.com/33e229c9df64bbc1037fd28e6cbe103c63830560b7e84efe35660e3c33bdb04e/68747470733a2f2f7472617669732d63692e6f72672f6d6f6f73656e642f776562736974652d747261636b696e672d7068702e737667)](https://travis-ci.org/moosend/website-tracking-php) [![Latest Stable Version](https://camo.githubusercontent.com/21d6054164ad4b3fd2ed370d8d810c4e3f737bc2ce40eb0b58924fc75508c89b/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f73656e642f747261636b65722f762f737461626c652e737667)](https://packagist.org/packages/moosend/website-tracking) [![License](https://camo.githubusercontent.com/0fda44bc5b6a35580050d3afbbea99999dfeacf5c71aa52a3443b77d95a4affc/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6f73656e642f747261636b65722f6c6963656e73652e737667)](https://packagist.org/packages/moosend/website-tracking)

Moosend tracking library
------------------------

[](#moosend-tracking-library)

#### Pulling dependencies

[](#pulling-dependencies)

This project uses [composer](https://getcomposer.org/) for auto-loading and managing dependencies.

To install all dependencies run : `composer install` from your terminal / cmd, if everything goes fine you should see **/vendor** directory on root of this directory.

#### Running tests

[](#running-tests)

This project relies on [phpspec](http://www.phpspec.net/en/latest/), an unit testing and BDD toolset. To run all tests type this on your terminal / cmd

```
composer test

```

#### Initialisation

[](#initialisation)

Before you dive in with sending events you have to create an instance of Tracker first and perform initialisation. This is very important as it wont send any data to the server without a proper initialisation. The init. phase deals with some Cookies that determines if current user is a new visitor or a returned one.

```
$trackerFactory = new Moosend\TrackerFactory();
$tracker = $trackerFactory->create($siteId, $requestUseragent, $requestIpAddress);

$tracker->init('site-id');

```

There is another alternative, by using the function called `track()` which creates the instance for you.

```
$tracker = track($siteId, $requestUseragent, $requestIpAddress);

```

You have to make sure that **vendor/autoload.php** is included somewhere on your code base in order to make this work.

#### Sending events

[](#sending-events)

```
//identify
$tracker->identify('some@mail.com', 'John Doe', ['favourite-color' => 'blue']); //returns GuzzleHttp\Psr7\Response

//page view
$tracker->pageView('http://example.com');

//add to order
$tracker->addToOrder('itemCode', 'itemPrice', 'itemUrl', 'itemName', 'itemImage', $props);

//order completed
$order = $tracker->createOrder();

$order->addProduct('itemCode', 'itemPrice', 'itemUrl', 'itemName', 'itemImage', $props);
//add as many products as you want before tracking and order completed event
$order->addProduct('itemCode', 'itemPrice', 'itemUrl', 'itemName', 'itemImage', $props);

$tracker->orderCompleted($order);

```

#### Add Subscription Forms

[](#add-subscription-forms)

In order to use Moosend subscription forms feature, you have to append our JS library into your HTML body, preferably in HEAD

```
//example how to embed JS snippet

```

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 81.6% 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 ~48 days

Recently: every ~240 days

Total

54

Last Release

1040d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d4a695c344e31417e3fd418bac11f8bca47657c76b94d1df07ef4ba60ba3a64?d=identicon)[moosend](/maintainers/moosend)

---

Top Contributors

[![shmaxuti](https://avatars.githubusercontent.com/u/139597654?v=4)](https://github.com/shmaxuti "shmaxuti (40 commits)")[![gentsp](https://avatars.githubusercontent.com/u/4760487?v=4)](https://github.com/gentsp "gentsp (3 commits)")[![yannnis](https://avatars.githubusercontent.com/u/581650?v=4)](https://github.com/yannnis "yannnis (3 commits)")[![vangisv](https://avatars.githubusercontent.com/u/113984858?v=4)](https://github.com/vangisv "vangisv (2 commits)")[![gentgaashi](https://avatars.githubusercontent.com/u/5548304?v=4)](https://github.com/gentgaashi "gentgaashi (1 commits)")

---

Tags

automationslibraryphptracking

### Embed Badge

![Health badge](/badges/moosend-website-tracking/health.svg)

```
[![Health](https://phpackages.com/badges/moosend-website-tracking/health.svg)](https://phpackages.com/packages/moosend-website-tracking)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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