Skip to content

Conversation

@dphiffer
Copy link
Contributor

@dphiffer dphiffer commented Aug 5, 2024

This PR augments the wp_split_tests table in order to combine raw event results into daily aggregate numbers. This is meant to consolidate records so that the table doesn't get bogged down over time. Any time a test is run, and any time there's a conversion, a record gets inserted into the table (granularity set to raw, count set to 1). This PR adds a cron task that runs twice daily and converts the previous days raw results into a single day record with a count set to the sum of the raw results.

  • Database migration adds granularity and count columns to the split_tests table (currently we only use raw granularity where each event has a count set to 1, but eventually we will aggregate events into day, week or month counts.)
  • Cron mechanism to aggregate raw records from the previous day into day records, twice daily.
  • Light refactor of Plugin.php splits functionality into sub-classes.
  • Fixes a bug where the default DOM variant wasn't able to track conversion events.
  • Adds some basic info to the readme files.

Before running the cron task

Screenshot 2024-08-06 at 9 48 58 AM

After running the cron task

Screenshot 2024-08-06 at 9 54 57 AM

@dphiffer dphiffer requested a review from BatMiles August 5, 2024 17:55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be committed? I am ignorant of the ways of wordpress databases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes the dev setup go a lot smoother, imo. I have a practice of clearing out the wp_split_test table, deleting the ACF Pro license key, and then exporting the db (it has admin / password login credentials). I should make a dev setup section in the readme that mentions that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh yes

@dphiffer dphiffer merged commit 7a17f33 into main Aug 6, 2024
@dphiffer dphiffer deleted the count-granularity branch August 6, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants