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)1121.6k↓34%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 3w 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

1085d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4236990?v=4)[Moosend](/maintainers/moosend)[@moosend](https://github.com/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

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k35](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

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