PHPackages                             jppreusdev/interactor - 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. jppreusdev/interactor

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

jppreusdev/interactor
=====================

A simple website user-interaction tracker.

v1.1.0(9y ago)017MITJavaScript

Since May 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/JPPreusDev/interactor)[ Packagist](https://packagist.org/packages/jppreusdev/interactor)[ RSS](/packages/jppreusdev-interactor/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

Interactor.js
=============

[](#interactorjs)

A simple, light-weight (&lt; 5KB minified), no dependency, front-end website interaction tracker.

Collects usage data and submits it to a user-defined server endpoint on the beforeunload event.

Great for creating a database to drive analytics, inform A/B testing, and guide other site optimization decisions.

This data can help you analyze:

- How your users navigate your website
- Engagement levels on a per-page and site-wide basis
- What platforms, language settings, and browser dimensions your users have
- Bounce rates, page and site bottle-necks, impressions, and conversions

Documentation
-------------

[](#documentation)

Documentation is currently being written. There's a working (front-end) [example of Interactor](http://greenstick.github.io/interactor/). To explore it, open up your browsers' console and click on the interaction and conversion buttons.

Interactor currently supports modern browsers: Chrome, Firefox, &amp; Safari. Additional testing &amp; input is welcome.

What Data is Provided?
----------------------

[](#what-data-is-provided)

General Data:

- Which page is loaded
- When the user loaded the page
- When the user left the page
- The URL of the loaded page
- The previous page location
- The title of the page
- The language settings of the user
- The user's platform
- The port used to access the web server
- The inner and outer width and height of the web browser

Interaction / Conversion Data:

- The interaction type (i.e. general interaction or conversion)
- The time of the interaction
- The event that triggered interaction
- The target HTML element tag
- The target HTML element classes
- The target HTML element content (i.e. text, etc.)
- The cursor position relative to client
- The cursor position relative to screen

Example Usage
-------------

[](#example-usage)

Include the script in your HTML and invoke it.

```

		Interaction Tracker Example

			// An example instantiation with custom arguments
			var interactions = new Interactor({
				interactions            : true,
				interactionElement      : "interaction",
				interactionEvents       : ["mousedown", "mouseup", "touchstart", "touchend"],
				conversions             : true,
				conversionElement       : "conversion",
				conversionEvents        : ["mouseup", "touchend"],
				endpoint                : '/usage/interactions',
				async                   : true,
				debug                   : false
			});

```

To track a users interactions with an element, simply add the 'interaction' CSS class to the element.

Have a conversion point on your page? You can add that too, just add the 'conversion' CSS class to your conversion's HTML element.

Want to track a user's interactions and/or conversions with different element classes already on your page? Create multiple instances and allow each to target a specific element to track. No update to your HTML neccessary!

Example:

```
var elementsToTrack = [
	{
		element: "element1",
		events : ["mouseup", "touchend"]
	},
	{
		element: "element2",
		events : ["mouseup"]
	},
	{
		element: "element3",
		events : ["mouseup"]
	}
];

for (var i = 0; i < elementsToTrack.length; i++) {
	var e = elementsToTrack[i];
	new Interactor({
		interactionElement 	: e.element,
		interactionEvents 	: e.events
	});
}

```

Default Parameters
------------------

[](#default-parameters)

```
{
	interactions            : true,
	interactionElement      : 'interaction',
	interactionEvents       : ['mouseup', 'touchend'],
	conversions             : false,
	conversionElement       : 'conversion',
	conversionEvents        : ['mouseup', 'touchend'],
	endpoint                : '/interactions',
	async                   : true,
	debug                   : true
}

```

Contributing
------------

[](#contributing)

Contributions are welcome!

Next up: addition of Web Socket mode.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.3% 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 ~0 days

Total

2

Last Release

3348d ago

### Community

Maintainers

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

---

Top Contributors

[![greenstick](https://avatars.githubusercontent.com/u/4184092?v=4)](https://github.com/greenstick "greenstick (42 commits)")[![JPPreusDev](https://avatars.githubusercontent.com/u/7678067?v=4)](https://github.com/JPPreusDev "JPPreusDev (2 commits)")[![gdarko](https://avatars.githubusercontent.com/u/5760249?v=4)](https://github.com/gdarko "gdarko (1 commits)")

### Embed Badge

![Health badge](/badges/jppreusdev-interactor/health.svg)

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

PHPackages © 2026

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