Gostaria de saber se alguém pode me ajudar com isso.
Estou tentando determinar quantos usuários estão usando os temas escuro ou claro. Montei o seguinte para o Explorador de Dados:
/* tema claro */
SELECT COUNT(*)
FROM user_options
WHERE theme_ids[1] = 6
Pelo que pude perceber, o ID do tema está armazenado no campo theme_ids, no elemento de índice 1. Alguém poderia confirmar isso?
Em nossa configuração, o tema escuro aparece com o valor 7 e o tema claro com o valor 6.
No entanto, ao executar as consultas, obtenho 140 pessoas usando o tema escuro e 32 usando o claro. Como temos vários milhares de usuários, esses números parecem um pouco baixos. Então, estou imaginando se minha consulta montada às pressas está errada ou se esses valores são armazenados apenas para usuários que definiram especificamente um tema, enquanto, se estiverem apenas usando o padrão, esses dados não são armazenados?
Many thanks for the link, and the swift response! I’m pleased to see that I was looking at the right fields.
Just to confirm, is the data that is returned for only the users that have specifically set their theme, e.g. any users who haven’t set it wouldn’t be returned in the data set, so we could just assume that they are using the default theme?
Perfectly fine if this is the case, just want the clarification please
I checked with @Osama and indeed, the query would only show those who’ve set a theme in their preferences that’s different from the default on your site.
It also includes those who’ve changed back to the default theme after choosing some other non-default theme.
For all intents and purposes, all users that the query returns that use the default theme + any users that don’t show up can be counted as users that use the default theme.
The query will also return a breakdown of the number of users that chose any other user-selectable themes on your site.
Awesome, many thanks for the confirmation and info and thanks for @Osama who’s query looks better than mine - albeit I got the same results - but I’ll pinch that one