Remove unused stats settings, only leave "Enable job statistics". Move it to the General settings tab since it's only one setting for now. Update labels.
Make sure the setting is respected & stats are not logged or displayed when it's off
Rename stats to make DB keys a bit shorter (job_listing_view -> job_view)
Add constants, cleanup code
Various tweaks for the frontend framework:
Organize and rename a few things for better clarity
Make stats triggered by a custom event/action (only page-load now) a dedicated stat type with it's own setup (action)
And to observing search impressions:
Use a single IntersectionObserver to monitor the listing elements. Also use this for the initially visible listings, it'll trigger even when they are already in view
Clean up observer when a listing element is removed (this happens when search filters/keywords are changed)
Send the log request right away when 10 events are in the queue
Fix some timing issues causing nodes to be skipped sometimes
Move the job listing selectors to the PHP stat config, so theme authors can customize them
Testing Instructions
In Job Manager settings, turn on the Job Statistics option
Check that stats are logged correctly when viewing a job page ( job_listing, job_listing_unique, job_apply_click)
Check that stats are logged when viewing the job list. Test with both ajax search and static: [jobs] and [jobs show_filters=false]
Check that the above logging is only done when the settings is turned on
Check that the Views column in Job listings admin and the job dashboard, and the Job statistics overlay is only shown when the settings is turned on
Screenshot / Video
Plugin build for c418e1b8dce425adc4dadfdb6d9a34e28e00f985
Fixes #2782 #2784
Stacked on #2776
Changes Proposed in this Pull Request
job_listing_view
->job_view
)page-load
now) a dedicated stat type with it's own setup (action
)Testing Instructions
[jobs]
and[jobs show_filters=false]
Screenshot / Video