PHPackages                             dekalee/adback-analytics - 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. dekalee/adback-analytics

ActiveLibrary

dekalee/adback-analytics
========================

A php lib to call the AdBack api

v1.9.1(8y ago)010.4k1Apache-2.0PHPPHP &gt;=5.3.3

Since Jan 10Pushed 8y ago6 watchersCompare

[ Source](https://github.com/dekalee/adback-analytics)[ Packagist](https://packagist.org/packages/dekalee/adback-analytics)[ RSS](/packages/dekalee-adback-analytics/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (14)Used By (1)

Adback/Analytics
================

[](#adbackanalytics)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a863f2484e915d927b154847210080aaacc570fe0c0ad963c7d51e4e0acffd43/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656b616c65652f61646261636b2d616e616c79746963732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dekalee/adback-analytics/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/caea437307f78271a98a920b94262787896348ce8f9bb599e2f5736094fa3a68/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64656b616c65652f61646261636b2d616e616c79746963732f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dekalee/adback-analytics/?branch=master)[![Build Status](https://camo.githubusercontent.com/2ce79afdbfc8260b2dbe4178a708499e33af2ca9ec08c6f5e9f182ffa2b7f1e5/68747470733a2f2f7472617669732d63692e6f72672f64656b616c65652f61646261636b2d616e616c79746963732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dekalee/adback-analytics)[![Latest Stable Version](https://camo.githubusercontent.com/009ce61d973edc5a082d8f9db39106d73e14c76a687e0058d638aac16a305061/68747470733a2f2f706f7365722e707567782e6f72672f64656b616c65652f61646261636b2d616e616c79746963732f762f737461626c65)](https://packagist.org/packages/dekalee/adback-analytics)[![Total Downloads](https://camo.githubusercontent.com/2955360a6ecd78f8a8b6d281a5c38959ade8aeb85e27ebf5840de5076fc918c3/68747470733a2f2f706f7365722e707567782e6f72672f64656b616c65652f61646261636b2d616e616c79746963732f646f776e6c6f616473)](https://packagist.org/packages/dekalee/adback-analytics)[![License](https://camo.githubusercontent.com/97db9225aa1219b1cf6c89bfb0b1b7c578434701301fd9509ace6f940de58391/68747470733a2f2f706f7365722e707567782e6f72672f64656b616c65652f61646261636b2d616e616c79746963732f6c6963656e7365)](https://packagist.org/packages/dekalee/adback-analytics)

This PHP library will call the AdBack API and will generate the JavaScript tag that should be placed on all the pages.

See [the AdBack website](http://adback.co) for more informations.

See [the AdBack documentation](http://support.adback.co/) for an installation guide.

Usage
-----

[](#usage)

Both the `Query` and `Generators` will need a driver which implements the `ScriptCacheInterface` to work.

A driver for Redis is already available.

Usage Exemple
-------------

[](#usage-exemple)

### Installation

[](#installation)

Use composer to install the lib :

```
    composer require dekalee/adback-analytics
```

### Usage with Redis

[](#usage-with-redis)

#### Query the api

[](#query-the-api)

First you need to query the api to warmup the cache in a Redis data store :

```
    use Dekalee\AdbackAnalytics\Client\Client;
    use Dekalee\AdbackAnalytics\Driver\RedisScriptCache;
    use Dekalee\AdbackAnalytics\Query\ScriptUrlQuery;

    function createApiCache()
    {
        $client = new Client();
        $redis = new \Redis();
        $redis->connect('127.0.0.1');
        $redisCache = new RedisScriptCache($redis);

        $query = new ScriptUrlQuery($client, $redisCache, 'your-token');
        $query->execute();
    }

    createApiCache();
```

#### Generate the scripts

[](#generate-the-scripts)

In your page, preferably in the ``, use the generator to create the script :

```
    use Dekalee\AdbackAnalytics\Driver\RedisScriptCache;
    use Dekalee\AdbackAnalytics\Generator\AnalyticsScriptGenerator;

    function generateAnalyticsScript()
    {
        $redis = new \Redis();
        $redis->connect('127.0.0.1');
        $redisCache = new RedisScriptCache($redis);
        $generator = new AnalyticsScriptGenerator($redisCache);

        return $generator->generate();
    }

    echo generateAnalyticsScript();
```

You could do the same to create the other scripts by using the appropriate generators.

### Usage with MySQL

[](#usage-with-mysql)

#### Create the table

[](#create-the-table)

To create the table used to store the data in MySQL, run the query:

```
    CREATE TABLE adback_cache_table( our_key varchar(255), our_value varchar(255));
```

#### With the PDO driver

[](#with-the-pdo-driver)

##### Query the api

[](#query-the-api-1)

First you need to query the api to warmup the cache in a Mysql table :

```
    use Dekalee\AdbackAnalytics\Client\Client;
    use Dekalee\AdbackAnalytics\Driver\PdoScriptCache;
    use Dekalee\AdbackAnalytics\Query\ScriptUrlQuery;

    function createApiCache()
    {
        $client = new Client();
        $connection = new \PDO('mysql:host=your-database-host;dbname=your-database;charset=utf8', 'login', 'password');
        $cache = new PdoScriptCache($connection);

        $query = new ScriptUrlQuery($client, $cache, 'your-token');
        $query->execute();
    }

    createApiCache();
```

##### Generate the scripts

[](#generate-the-scripts-1)

In your page, preferably in the ``, use the generator to create the script :

```
    use Dekalee\AdbackAnalytics\Generator\AnalyticsScriptGenerator;
    use Dekalee\AdbackAnalytics\Driver\PdoScriptCache;

    function generateAnalyticsScript()
    {
        $connection = new \PDO('mysql:host=your-database-host;dbname=your-database;charset=utf8', 'login', 'password');
        $cache = new PdoScriptCache($connection);
        $generator = new AnalyticsScriptGenerator($cache);

        return $generator->generate();
    }

    echo generateAnalyticsScript();
```

You could do the same to create the other scripts by using the appropriate generators.

#### With the Mysqli driver

[](#with-the-mysqli-driver)

##### Query the api

[](#query-the-api-2)

First you need to query the api to warmup the cache in a Mysql table :

```
    use Dekalee\AdbackAnalytics\Client\Client;
    use Dekalee\AdbackAnalytics\Driver\MysqliScriptCache;
    use Dekalee\AdbackAnalytics\Query\ScriptUrlQuery;

    function createApiCache()
    {
        $client = new Client();
        $connection = new \mysqli('your-database-host', 'login', 'password', 'your-database');
        $cache = new MysqliScriptCache($connection);

        $query = new ScriptUrlQuery($client, $cache, 'your-token');
        $query->execute();
    }

    createApiCache();
```

##### Generate the scripts

[](#generate-the-scripts-2)

In your page, preferably in the ``, use the generator to create the script :

```
    use Dekalee\AdbackAnalytics\Generator\AnalyticsScriptGenerator;
    use Dekalee\AdbackAnalytics\Driver\PdoScriptCache;

    function generateAnalyticsScript()
    {
        $connection = new \mysqli('your-database-host', 'login', 'password', 'your-database');
        $cache = new MysqliScriptCache($connection);
        $generator = new AnalyticsScriptGenerator($cache);

        return $generator->generate();
    }

    echo generateAnalyticsScript();
```

You could do the same to create the other scripts by using the appropriate generators.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 71.8% 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 ~11 days

Recently: every ~2 days

Total

13

Last Release

3273d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2675545?v=4)[Nicolas Thal](/maintainers/nicolasThal)[@nicolasThal](https://github.com/nicolasThal)

![](https://www.gravatar.com/avatar/db41627d2f062afcd3558e79eb75ef060f04d2f57644be8bae8dff0f48e71812?d=identicon)[maximevalette](/maintainers/maximevalette)

![](https://www.gravatar.com/avatar/81e74183a746c1d0813128bea90894477d621a72a1290bc540c225728f70109e?d=identicon)[victorbalssa](/maintainers/victorbalssa)

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

![](https://www.gravatar.com/avatar/bce05fefcead2a9f1fadaa947173566615109994b6abfc58e1b28ea92d0f551f?d=identicon)[gbd\_dkl](/maintainers/gbd_dkl)

![](https://www.gravatar.com/avatar/e73e174d1886fbe852bf12e779513667b8e94dd152817640af9925cd1f334981?d=identicon)[julienguilmont](/maintainers/julienguilmont)

---

Top Contributors

[![nicolasThal](https://avatars.githubusercontent.com/u/2675545?v=4)](https://github.com/nicolasThal "nicolasThal (28 commits)")[![sempixel](https://avatars.githubusercontent.com/u/1658628?v=4)](https://github.com/sempixel "sempixel (11 commits)")

### Embed Badge

![Health badge](/badges/dekalee-adback-analytics/health.svg)

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

PHPackages © 2026

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