Proposal to retrieve count in Piwik/Matomo analytics#4
Proposal to retrieve count in Piwik/Matomo analytics#4cedfou wants to merge 1 commit intoJahia:masterfrom
Conversation
We have developed a Piwik/Matomo analytics module, that included numerous advanced functionalities, including internal search tracking one (based on this doc: https://matomo.org/docs/site-search/ ) BUT, to be allowed to retrieve the correct "count" results value, we need to have a HTML/CSS marker to separate the 'count number' part from the rest of the content. This submission is a proposal to mark the count result with a surrounding HTML SPAN element for easy retrieval of this value (through a class="stats_count" CSS selector for example). Important: the same modification (add of SPAN around result number var) should be done in all the other languages files. REM: another solution could be to split the 'search.results.XXX.found' variables in 2 and add the HTML into the view (but it requires more modifications); it's up to you to decide... Regards,
|
Hi Cédric thank you for the contribution. I'm not sure how much I like the HTML directly in the resource bundle and was wondering if there was another way we could "mark" the value ? I'm not sure the other proposed solution is any better to be honest :) |
|
Hi Serge, Piwik use CSS selector to retrieve this count value. So all solution that allow that will be OK... |
|
Ok if I understand correctly the "stats_count" could be named differently ? If so we might want to use something that might make more semantic sense like search_result_count and that would potentially conflict less if it's used elsewhere in Piwik ? |
|
Exact. |
Description
We have developed a Piwik/Matomo analytics module, that included numerous advanced functionalities, including internal search tracking one (based on this doc: https://matomo.org/docs/site-search/ )
BUT, to be allowed to retrieve the correct "count" results value, we need to have a HTML/CSS marker to separate the 'count number' part from the rest of the content.
This submission is a proposal to mark the count result with a surrounding HTML SPAN element for easy retrieval of this value (through a class="stats_count" CSS selector for example).
Important: the same modification (add of SPAN around result number var) should be done in all the other languages files.
REM: another solution could be to split the 'search.results.XXX.found' variables in 2 and add the HTML into the view (but it requires more modifications); it's up to you to decide...
Regards,