Explorador de datos: consulta para determinar las preferencias de tema del usuario

Hola a todos,

Me pregunto si alguien puede ayudarme con esto.

Estoy intentando determinar cuántos usuarios están utilizando los temas oscuro o claro. He reunido lo siguiente para el Explorador de Datos:

/* tema claro */
SELECT COUNT(*)
FROM user_options
WHERE theme_ids[1] = 6

Por lo que puedo ver, el ID del tema se almacena en el campo theme_ids y en el elemento 1 del array. ¿Alguien podría confirmarme esto?

En nuestra configuración, el tema oscuro aparece como un valor de 7 y el tema claro como un valor de 6.

Sin embargo, al ejecutar las consultas obtengo 140 personas usando el modo oscuro y 32 usando el claro. Dado que tenemos varios miles de usuarios, esto parece un poco bajo, así que supongo que mi consulta improvisada es incorrecta, o ¿estos valores solo se almacenan para los usuarios que han configurado específicamente un tema, mientras que si solo están usando el predeterminado, estos datos no se guardan?

Cualquier información sería muy apreciada.

I believe @osama has already created a query that allows you to check a theme’s popularity. Have a look here

5 Me gusta

Hi Joe,

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 :slight_smile:

3 Me gusta

No worries Rob,

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.

7 Me gusta

Hey Joe,

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 :wink:

4 Me gusta

This topic was automatically closed after 39 hours. New replies are no longer allowed.