DanielSiepmann / tracking

TYPO3 Extension providing server side tracking.
https://daniel-siepmann.de/projects/typo3-extension-tracking.html
GNU General Public License v2.0
17 stars 2 forks source link

Is there a maintenance possible / needed / sensful for table tx_tracking_pageview / recordview? #119

Open subnoodle opened 1 month ago

subnoodle commented 1 month ago

Dear Daniel,

your extension is really cool and runs in between for a while in one of the websites i maintain. Now, the table tx_tracking_pageview has ~700.000 entries. This leads to an intensive duration when updating the reference index. I discoverd the scheduler-job / CLI tracking:updatedata. In the docs is it nowhere mentioned, so i'm asking myself what is updated, why reference-index does consider it at all, and if this command does also a kind of cleanup.

Any information about the cummulating sizes of these tables and data-cleansing in relation with tracking-statistic-timespans would be very useful.

Thank you for all your effort! Sam

DanielSiepmann commented 1 month ago

Hey,

thanks for using the extension and asking for feedback here.

The provided command will try to extract more data if possible. That might happen if you installed an early version and the extension could now extract more data. It will basically go through all the data and extract information from the stored User-Agent once more.

Now to the refindex: Each entry has a relation to a TYPO3 page, it might check this relation all the time, but I would need to check it myself. Unfortunately I'm on vacation right now and can't promise to have a look earlier than 28th of October, but I've added a reminder for myself and will investigate if I could improve that situation. Which TYPO3 version do you use? So I can check the refindex situation with the same version.

subnoodle commented 1 month ago

Hi Daniel, thank you for your reply. There's no hurry on it at all. I use version 11 currently (updating soonish to 12). The interessting part will be, if there is a chance for a function to delete "outdated" records from the tracking-tables. What is "outdated"? Could be configured in the extension settings, in months or years. 100 years (never) or 1 year (less rows in the table). What i do not know here, if it's easy or hard to make a timespan work here (according the tables-setup).

Thank you, Sam

DanielSiepmann commented 1 month ago

Hey @subnoodle,

I guess you've EXT:scheduler system extension installed and enabled in your system? Can you check its docs: https://docs.typo3.org/c/typo3/cms-scheduler/11.5/en-us/Installation/BaseTasks/Index.html#table-garbage-collection-task whether that might solve your issue?

Concrete example could be (untested):

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_tracking_pageview'] = [
   'dateField' => 'crdate',
   'expirePeriod' => '180',
];
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['tx_tracking_recordview'] = [
   'dateField' => 'crdate',
   'expirePeriod' => '180',
];

Place this within the additional configuration or ext_localconf.php of your sitepackage. The 180 is an example, adjust to your own needs, e.g. 1 year.

Would be cool if you could give it a try and provide feedback. I'd happily add it to the docs of EXT:tracking if that's helpful.