Problem/Motivation

Table ad_track_event grows large very fast. Just after some days it has grown to 4.9 GB.
It should therefore allow to be limited to clicks only.

Also, we should inform users about this to be aware! Tracking every view is just far too much.

Steps to reproduce

Use event tracking on a highly frequented project and see the table grow extremely fast!

Proposed resolution

We will create a settings page for the ad_tack module with the following settings:

Totals tracking

  • Track total impressions (Enabled via update hook)
  • Track total clicks (Enabled by default)

Event tracking

  • Track impression events (Enabled via update hook)
  • Track click events (Enabled via update hook)
Event metadata
  • IP address (Disabled)
  • User agent (Enabled via update hook)
  • URL (Enabled by default)
  • Page title (Enabled by default)
  • Referrer (Enabled by default)

[Clear event data] (Button to flush the ad_track_impression table)

Ideally the settings should already be taken into account in the JS library, so that, when neither total nor event tracking is enabled for an event type (click / impression), no request to the controller is made at all to save on performance.

There should also be a warning message on the settings page when the ad_track module is not enabled to inform the user of the fact. Warnings in the settings descriptions are also necessary for settings that may lead to performance impacts or huge storage increases on larger sites.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork ad-3587809

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

anybody created an issue. See original summary.

anybody’s picture

Having ad_track_total is probably also enough for many cases. We should discuss how to improve that and make it configurable in general.

anybody’s picture

anybody’s picture

As a workaround we for now disabled ad tracking in general.

lrwebks made their first commit to this issue’s fork.

lrwebks’s picture

Initially there was a view at some point which allowed admins to view more detailed information about the ad impressions (including a graph over time). So that's where the need for all the metadata in ad_track_event stems from. I do not believe that the view is currently used anymore. If so, it is definitely not using the most up-to-date data model that we have established in 11.x. So I see a few possible options here among others:

  1. Add settings to limit / restrict the entries in the table (like max 5000 entries or only clicks or other settings)
  2. Get rid of ad_track_event and only increment ad_track_total instead of deriving the total tally from the event table
  3. Do not store any metadata in the table that was previously used for the view and instead only track ad-id and whether it was a click or an impression, so that the table size should be reduced significantly

@anybody, what would you be most in favor of?

anybody’s picture

I think we need a settings based version of (2). Let's discuss this in person.

lrwebks’s picture

Discussed with @anybody, I will update the issue summary to reflect our plans for this.

lrwebks’s picture

Issue summary: View changes

lrwebks’s picture

Assigned: lrwebks » Unassigned
Status: Active » Needs review
anybody’s picture

Assigned: Unassigned » lrwebks
Status: Needs review » Needs work
lrwebks’s picture

Assigned: lrwebks » Unassigned
Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Reviewed & tested by the community

Okay I think this is a huge and important improvement! Let's merge this.

Next very important follow-up is having tests for all that.

anybody’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.