Data Explorer - Query per determinare le preferenze di tema dell'utente

Ciao a tutti,

Mi chiedevo se qualcuno potesse aiutarmi con questo.

Sto cercando di determinare quanti utenti stanno utilizzando il tema scuro o chiaro. Ho assemblato questa query per l’Esploratore Dati:

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

Da quanto riesco a capire, l’ID del tema è memorizzato nel campo theme_ids nell’elemento dell’array 1; qualcuno può confermare?

Nel nostro setup, il tema scuro appare come valore 7 e il tema chiaro come valore 6.

Tuttavia, quando eseguo le query ottengo 140 persone che usano il tema scuro e 32 che usano quello chiaro. Dato che abbiamo diverse migliaia di utenti, questi numeri sembrano un po’ bassi, quindi ipotizzo che la mia query assemblata sia errata oppure che questi valori siano memorizzati solo per gli utenti che hanno impostato specificamente un tema, mentre se stanno usando quello predefinito questi dati non vengono salvati?

Qualsiasi informazione sarebbe davvero apprezzata.

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

5 Mi Piace

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 Mi Piace

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 Mi Piace

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 Mi Piace

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