User tests: Successful: Unsuccessful:
Pull Request resolves #46880
This PR enhances the getItem method in com_banners to include state and publishing date validation. By adding these conditions to the database query, we ensure that banner data (including the click URL) is only retrieved if the banner is currently active.
Added $nowDate using Factory::getDate()->toSql() for precise timing.
Extended the WHERE clause to check for state = 1.
Added logic to respect publish_up and publish_down fields (including NULL checks).
The getItem method retrieves banner details regardless of the publication status, allowing the click-tracking logic to increment counters for inactive ads. This results in "ghost clicks" visible in reporting tools like Looker Studio, where clicks are recorded despite 0 impressions.
Banner data is only returned if the banner is published and within the valid date range. Inactive banners will no longer have their clicks tracked.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Front End com_banners |
| Title |
|
||||||
How can inactive banners get cklicks?
from a page cache?
How can inactive banners get cklicks?
The primary issue is automated traffic from bots or crawlers (like Google or specialized bots) that still have old click-URLs in their index. Here is an example from my server logs:
13/Feb/2026:00:12:03 +0100] "GET /component/banners/click/288 HTTP/1.1" 404 5527 "-" "Mozilla/5.0 (compatible; FleebsBot/1~w; +https://fleebs.com/bot)" www.domain.tld
Data Integrity: Currently, Joomla counts these as valid clicks if the ID exists, even if the banner is unpublished or expired. This leads to "ghost clicks" that skew reporting data.
Correct Response: With my fix, the system correctly validates the state and publishing dates within the getItem method. As seen in the log, the server now appropriately returns a 404 instead of processing an invalid interaction.
Returning a 404 is the correct technical response for a resource that is no longer "active" for the public, ensuring clean statistics and better resource management.
Bug confirmed: The change fixes incorrect behavior where inactive banners were still processed (e.g., click tracking continued even when a banner was unpublished or expired).
| Labels |
Added:
bug
PR-5.4-dev
|
||
I have tested this item ✅ successfully on 0fd57ff
I have tested this item ✅ successfully on 0fd57ff
| Status | Pending | ⇒ | Ready to Commit |
RTC
| Labels |
Added:
RTC
|
||
How can inactive banners get cklicks?