PHPackages                             trialfireinc/tracker - 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. trialfireinc/tracker

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

trialfireinc/tracker
====================

Trialfire tracking module for Magento 2

v1.1.4(3y ago)16031[1 issues](https://github.com/trialfire/magento2-tracker/issues)OSL-3.0PHPPHP ^7.1.0 || ^8.0.0

Since May 11Pushed 3y ago6 watchersCompare

[ Source](https://github.com/trialfire/magento2-tracker)[ Packagist](https://packagist.org/packages/trialfireinc/tracker)[ RSS](/packages/trialfireinc-tracker/feed)WikiDiscussions master Synced today

READMEChangelog (9)DependenciesVersions (10)Used By (0)

Trialfire/Tracker
=================

[](#trialfiretracker)

This module adds support for Trialfire to Magento 2. In addition to normal behavioural tracking, the following events are also collected:

- Viewed Category
- Viewed Product
- Add to Cart
- Add to Whishlist
- Remove from Cart
- Started Checkout
- Completed Order
- Subscribed Newsletter
- Register an Account

Install
-------

[](#install)

### Install from Magento Marketplace

[](#install-from-magento-marketplace)

### Install from Command Line

[](#install-from-command-line)

1. Require the trialfireinc/tracker package. A list of version tags is available [here](https://github.com/trialfire/magento2-tracker/releases).

```
php composer.phar require trialfireinc/tracker:v1.1.4

```

2. Enable the module.

```
bin/magento module:enable Trialfire_Tracker --clear-static-content
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
bin/magento cache:clean

```

Configure
---------

[](#configure)

The only required configuration is the API key from your project in Trialfire. You can find the API key by logging in to your Trialfire account and navigating to *Settings &gt; Tracking Code and API key*.

1. Open the Admin page for your store and navigate to *Stores &gt; Configuration*, then click on the **Trialfire** tab.
2. Set the **Enable Tracking** field to **Yes**, and then input your API key into the **API token** field.
3. Save the configuration.
4. Flush the **Configuration**, **Block HTML**, and **Full\_Page** caches. You can clear the caches from *System &gt; Cache Management* or use the command `bin/magento cache:flush config block_html full_page`.

### Advanced Configuration

[](#advanced-configuration)

Complete documentation is available [here](https://docs.trialfire.com/#/magento2-tracker).

#### Custom Initialization

[](#custom-initialization)

Customize how Trialfire tracking code is included into the DOM. The default implementation is similar to the following:

```
var s = document.createElement('script');
s.src = this.assetUrl;
document.head.appendChild(s);
Trialfire.init(this.apiToken);
```

The value of `this` for the custom initializer is the following.

```
{
  // The value of the Asset URL setting in your store's Trialfire configuration.
  assetUrl: '...',

  // The value of the API Token setting in your store's Trialfire configuration.
  apiToken: '...',

  /**
   * Call the default initialization logic.
   */
  callDefaultInit: function () ...

  /**
   * Inject the Trialfire script into the DOM but do not call Trialfire.init().
   */
  injectScript: function () ...
}
```

To prevent Trialfire from loading on the 'agent' subdomain, input the following JavaScript into the **Initialization Code** textarea.

```
// If host does not start with 'agent'.
if (!location.host.startsWith('agent.myshop.com')) {
  // Invoke the default initialization logic.
  this.callDefaulInit();
}
```

#### Custom Event Handlers

[](#custom-event-handlers)

Customize how Trialfire fires tracking events. The value of `this` for the custom event handler is the following.

`this.event`: An object containing information about the event. The contents vary with the event type but are similar to the following.

```
this.event = {
  $name: 'placeOrder',
  apiToken: '...',
  userId: 1,
  traits: {
    email: '...',
    firstName: '...'
  },
  props: {
    orderId: '...',
    products: [{
      id: '...',
      name: '...',
      sku: '...'
    },{
      ...
    }]
  }
}
```

`this.tfMage`: The service which tracks the events. It contains utility methods that you may use in your custom handler.

```
this.tfMage = {
  /**
   * Calls the default handler for an event.
   */
  callDefaultEventHandler: function (event) ...
};
```

**Example:**

To prevent Trialfire from tracking orders on the 'agent' subdomain, input the following JavaScript into the **Place Order** textarea.

```
// If host does not start with 'agent'.
if (!location.host.startsWith('agent.myshop.com')) {
  // Invoke the default handler for this event.
  this.tfMage.callDefaultEventHandler(this.event);
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~133 days

Recently: every ~170 days

Total

9

Last Release

1178d ago

PHP version history (4 changes)v1.0.0-betaPHP ~7.2.0||~7.3.0

1.0.0PHP ~7.1.0||~7.2.0||~7.3.0

v1.1.2PHP ^7.1.0

v1.1.3PHP ^7.1.0 || ^8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4428698?v=4)[CognitionDigital.io, Inc. (Trialfire)](/maintainers/trialfire)[@trialfire](https://github.com/trialfire)

---

Top Contributors

[![marklieberman](https://avatars.githubusercontent.com/u/6473247?v=4)](https://github.com/marklieberman "marklieberman (33 commits)")

### Embed Badge

![Health badge](/badges/trialfireinc-tracker/health.svg)

```
[![Health](https://phpackages.com/badges/trialfireinc-tracker/health.svg)](https://phpackages.com/packages/trialfireinc-tracker)
```

PHPackages © 2026

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