PHPackages                             solidwork/contao-solid-ads-tracker-bundle - 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. solidwork/contao-solid-ads-tracker-bundle

ActiveContao-bundle[Utility &amp; Helpers](/categories/utility)

solidwork/contao-solid-ads-tracker-bundle
=========================================

Tracks visitors from Google Ads (gclid) and Bing Ads (msclkid) and logs them in the Contao 5 backend.

v1.0.1(2mo ago)021↓100%LGPL-3.0-or-laterPHPPHP ^8.1

Since Feb 27Pushed 2mo agoCompare

[ Source](https://github.com/ArturJo/contao-solid-ads-tracker-bundle)[ Packagist](https://packagist.org/packages/solidwork/contao-solid-ads-tracker-bundle)[ RSS](/packages/solidwork-contao-solid-ads-tracker-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Contao Solid Ads Tracker Bundle
===============================

[](#contao-solid-ads-tracker-bundle)

A Contao 5.3 bundle for automatically tracking visitors who arrive via **Google Ads** (`gclid`) or **Bing Ads** (`msclkid`).

Features
--------

[](#features)

- Automatic detection of Google Ads clicks (`gclid`) and Bing Ads clicks (`msclkid`)
- Stores all hits in a dedicated database table (`tl_solid_ads_visit`)
- Records all UTM parameters (`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`)
- Backend module under **System → Ads Tracker** for reviewing all tracked visits
- Date range filter (From / To) with live entry count display
- Dropdown filters by source (Google / Bing), UTM Source, Medium and Campaign
- Full-text search across URL, Click-IDs, UTM parameters, referrer and user agent
- Detail view per entry with all stored fields
- Export filtered data as **CSV** or **JSON** (filename includes date, time and active filters)
- Installable via Contao Manager

---

Installation
------------

[](#installation)

### Via Contao Manager (recommended)

[](#via-contao-manager-recommended)

1. Open Contao Manager
2. Search for `solidwork/contao-solid-ads-tracker-bundle`
3. Install and update the database
4. Run the required setup via SSH (see section below)

### Via Composer

[](#via-composer)

```
composer require solidwork/contao-solid-ads-tracker-bundle
```

Then create the database table:

```
php bin/console contao:migrate
```

---

⚠️ Required: One-Time Setup
---------------------------

[](#️-required-one-time-setup)

**This step is mandatory.** Without it, tracking will not work on production Contao installations that use the built-in HTTP cache.

Run the included setup command once after installation:

```
php bin/console solidwork:ads-tracker:setup
php bin/console cache:clear
```

This command automatically:

1. Adds `QUERY_PARAMS_REMOVE_FROM_DENY_LIST=gclid,msclkid` to your `.env.local`
2. Clears the HTTP cache directory (`var/cache/prod/http_cache/`)

### Why this is needed

[](#why-this-is-needed)

Contao's built-in HTTP cache (`ContaoCache`) normalizes URLs before checking the cache. By default, it **strips** tracking parameters like `gclid` and `msclkid`:

- A request for `/?gclid=test9999` is normalized to `/?`
- If `/?` is already cached, the full page is served from cache without the inner application ever seeing the `gclid`
- The tracking listener never fires for the original visitor request

The env variable `QUERY_PARAMS_REMOVE_FROM_DENY_LIST=gclid,msclkid` prevents this stripping, so each ad click URL gets its own cache entry and the tracking listener is called correctly.

> **Manual alternative:** If you prefer, add `QUERY_PARAMS_REMOVE_FROM_DENY_LIST=gclid,msclkid` to `.env.local` by hand, then run `rm -rf var/cache/prod/http_cache/ && php bin/console cache:clear`.

---

Console Commands
----------------

[](#console-commands)

### Run setup (required once)

[](#run-setup-required-once)

Configures `.env.local` and clears the HTTP cache:

```
php bin/console solidwork:ads-tracker:setup
php bin/console cache:clear
```

### Run database migration

[](#run-database-migration)

After installation, create the table:

```
php bin/console contao:migrate
```

### Load demo entries

[](#load-demo-entries)

To test the backend view with sample data:

```
php bin/console solidwork:ads-tracker:load-fixtures
```

Creates 10 realistic demo entries (Google Ads &amp; Bing Ads) spread over 60 days. Visible in the Contao backend under **System → Ads Tracker** afterwards.

---

Backend Module
--------------

[](#backend-module)

The module appears in the Contao backend under **System → Ads Tracker**.

### List View

[](#list-view)

Displays all tracked visits with the following columns:

ColumnDescription`#`Entry IDSourceGoogle Ads or Bing AdsDate &amp; TimeTimestamp of the visitUTM Sourceutm\_source parameterUTM Mediumutm\_medium parameterUTM Campaignutm\_campaign parameterVisited URLFull URL of the visit### Date Range Filter

[](#date-range-filter)

A date range (From / To) can be entered in the top panel. After clicking **Apply**, the list is restricted to that period. The current entry count is displayed next to the filter:

- Without filter: `13 entries total`
- With filter: `3 of 13 entries`

### Dropdown Filters

[](#dropdown-filters)

Filter by the following fields via dropdown:

- **Source** – Google Ads or Bing Ads
- **UTM Source**
- **UTM Medium**
- **UTM Campaign**

### Search

[](#search)

Full-text search across the following fields:

- Visited URL
- Google Click-ID (`gclid`)
- Bing Click-ID (`msclkid`)
- UTM parameters
- Referrer
- Browser / User-Agent

### Detail View

[](#detail-view)

Clicking the info icon opens the detail view with all stored fields for that entry.

### Export

[](#export)

Use the **Export CSV** and **Export JSON** buttons to download all currently filtered entries. The export respects all active filters:

- Date range filter (From / To)
- Dropdown filters (Source, UTM Source, UTM Medium, UTM Campaign)

The filename automatically includes the date, time and active filters, e.g.:

```
ads-tracker_2026-02-27_14-32-05_source-google_utm_campaign-winter2026.csv
ads-tracker_2026-02-27_14-32-05_2026-02-01_bis_2026-02-27.json

```

---

How Does Tracking Work?
-----------------------

[](#how-does-tracking-work)

The bundle registers a Symfony event listener on `kernel.request` (priority 8). On every GET request it checks for a `gclid` (Google Ads) or `msclkid` (Bing Ads) parameter in `$_GET`. If found, the visit is immediately saved to the database.

AJAX requests are ignored. If an error occurs (e.g. table not yet created), the listener fails silently without affecting the page.

### Contao HTTP Cache compatibility

[](#contao-http-cache-compatibility)

Contao uses a built-in HTTP cache (`ContaoCache`) in production. Without the `QUERY_PARAMS_REMOVE_FROM_DENY_LIST` configuration described above, the tracking listener will never be called for ad clicks because:

1. Contao strips `gclid`/`msclkid` from the URL to create a normalised cache key
2. The normalised URL (e.g. `/?`) likely exists in cache → the cached response is returned directly
3. The inner Symfony application (and therefore this listener) is never invoked

With the env variable set, each `gclid`/`msclkid` URL gets its own cache entry and the full request reaches the tracking listener correctly.

---

Database Structure (`tl_solid_ads_visit`)
-----------------------------------------

[](#database-structure-tl_solid_ads_visit)

ColumnTypeDescription`id`INTPrimary key, auto-increment`tstamp`INTUnix timestamp (internal)`source`VARCHAR(10)`google` or `bing``visited_at`VARCHAR(20)Date &amp; time (`Y-m-d H:i:s`)`page_url`TEXTFull URL of the visited page`gclid`VARCHAR(255)Google Ads Click-ID`msclkid`VARCHAR(255)Bing Ads Click-ID`utm_source`VARCHAR(255)UTM parameter: source`utm_medium`VARCHAR(255)UTM parameter: medium`utm_campaign`VARCHAR(255)UTM parameter: campaign`utm_term`VARCHAR(255)UTM parameter: term`utm_content`VARCHAR(255)UTM parameter: content`referrer`TEXTHTTP referrer header`user_agent`TEXTBrowser / user agent---

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Contao 5.3 or higher

---

License
-------

[](#license)

LGPL-3.0-or-later – see [LICENSE](LICENSE)

Author
------

[](#author)

[Solidwork](https://github.com/ArturJo)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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 ~3 days

Total

2

Last Release

68d ago

### Community

Maintainers

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

---

Tags

adstrackingcontaoanalyticsbing adsgoogle adsgclidmsclkid

### Embed Badge

![Health badge](/badges/solidwork-contao-solid-ads-tracker-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/solidwork-contao-solid-ads-tracker-bundle/health.svg)](https://phpackages.com/packages/solidwork-contao-solid-ads-tracker-bundle)
```

###  Alternatives

[zumba/amplitude-php

PHP SDK for Amplitude

409.5M5](/packages/zumba-amplitude-php)[madeyourday/contao-rocksolid-custom-elements

Create your own, nestable content elements using a modular system. End the WYSIWYG chaos with your own content elements.

50341.9k12](/packages/madeyourday-contao-rocksolid-custom-elements)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[terminal42/contao-folderpage

Provides a new page type for Contao that allows you to group pages into folders.

18147.9k9](/packages/terminal42-contao-folderpage)[inspiredminds/contao-wowjs

Integrates WOW.js for Contao content elements and form fields.

1813.0k](/packages/inspiredminds-contao-wowjs)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1414.8k](/packages/pdir-social-feed-bundle)

PHPackages © 2026

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