listmonk/i18n
Kailash Nadh 2614b072f2 Refactor campaign analytics to show unique / non-unique data.
The analytics page showed non-unique counts for views and clicks which
was misleading and source of confusion: #522, #561, #571, #676, #680
This commit changes this behaviour to pull unique views and clicks when
individual subscriber tracking is turned on in settings, and non-unique
counts when it is turned off (as `subscriber_id` in `campaign_views`
and `link_clicks` will be NULL, rendering unique queries dysfunctional).

This commit changes the stats SQL queries to use string interpolation
to either to SELECT `*` or `DISTINCT subscriber_id` on app boot based
on the setting in the DB. This involves significant changes to how
queries are read and prepared on init.

- Refactor `initQueries()` to `readQueries()` and `prepareQueries()`.
- Read queries first before preparing.
- Load settings from the DB using the read settings query.
- Prepare queries next. Use the privacy setting from the DB to apply
  string interpolation to the analytics queries to pull
  unique/non-unique before preparing the queries.

On the UI:
- Show a note on the analytics page about unique/non-unique counts.
- Hide the % donut charts on the analytics page in non-unique mode.

Closes #676, closes #680
2022-02-01 23:40:03 +05:30
..
cs-cz.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
de.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
en.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
es.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
fr.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
hu.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
it.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
ml.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
nl.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
pl.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
pt-BR.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
pt.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
ro.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
ru.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30
tr.json Refactor campaign analytics to show unique / non-unique data. 2022-02-01 23:40:03 +05:30