StatPress Community Forum > Feature Suggestions

Exclude pages/urls from statistics

(1/2) > >>

simik:
I have installed a theme which supports customization of layout, colors and other stuff, which is implemented via dynamic PHP-generated CSS and JS files. These files are displayed by StatPress as separate pages, so for every legitimate page shown another two (CSS and JS) get counted. Is there any way to exclude pages/urls, and if not, would you consider adding this feature?

forumadmin:
Hi simik:
Currently StatComm 1.6.90 filters most common regular extensions, but the user can't change it (yet , but it will shortly). These extensions are .ico, .css,.js, .jpg,.jpeg,.png and .gif.

Certainly we miss the case of CSS / JS / (pick your extension here)  PHP-generated, and we also know this is fairly common scenario (even we made some themes using this concept).

Filtering pages from the traffic it is very interesting indeed so we already added to request's list. It is very likely it would come with two options: filter the traffic directly (without saving to the database) and/or filtering from the views (saving it but no displaying it).

Thinking forward we can quickly add a feature where you could control what exactly want to filter out before saving to the database. In this way we would solve your request, although you would need to add a couple of lines to the theme function to start filtering pages. The good news is you will be in full control of the filter and it can be implemented in the next version.

Being said, with a great power comes a great responsibility. You should be aware of few things:

* The filter function would impact in the overall capture process performance. So the faster is the filter, the better.
* If the filter gets a programming glitch, the plugin could stop capturing records or even worst , stop the entire site. Be sure to test it in a safe environment.
* What you filter, you won't save it, so be careful.
* A more friendly approach will be implemented on future versions, but isn't scheduled yet (we are just scheduling your idea remember :) and we have to make room for it ) . The friendly approach will combine filtered pages from user interface with those coming from the filter, so it should be future-compatible.
We'll add code samples to show how this filter would work.

Best Regards
Fernando




simik:
Thanks for such a detailed answer. I've modified your code and added a couple lines after your extension check to filter out these particular CSS/JS requests (these requests look like itx=css&ver=1.2.3, that's why they were not filtered out by your extension check). It's a dirty hack but it will do till you implement user-defined filters.

forumadmin:
Great. I glad you made it.
Don't worry about the hack, with the next version you will adapt easily the code to the examples.

Best regards.
Fernando

forumadmin:
In StatComm version 1.7.01 we added a new capability using statcomm_preinsert filter.
The filter gives the possibility to filter data before saving and also discard it just returning null or empty string ('').

We expect to publish some additional information in these days along with some examples.

Best Regards
Fernando

Navigation

[0] Message Index

[#] Next page

Go to full version