Data Explorer - ユーザーのテーマ設定を特定するクエリ

こんにちは、皆様。

どなたかお手伝いいただけないでしょうか。

ユーザーが「ダーク」テーマまたは「ライト」テーマのどちらを使用しているかを把握したいと考えており、Data Explorer 用に以下のようなクエリを組み立てました。

/* light theme */
SELECT COUNT(*)
FROM user_options
WHERE theme_ids[1] = 6

私の理解では、テーマの ID は theme_ids フィールドの配列要素 1 に格納されているようですが、これについてご確認いただけますでしょうか。

当社の設定では、ダークテーマの値は 7、ライトテーマの値は 6 となっています。

しかし、これらのクエリを実行すると、ダークテーマ使用者は 140 人、ライトテーマ使用者は 32 人という結果になります。数千人のユーザーがいることを考えると、この数字は少なすぎるように思えます。私の組み立てたクエリが間違っているのか、それともこれらの値は「ユーザーが明示的にテーマを設定した場合」のみ格納され、デフォルト設定のままの場合はデータが保存されないのでしょうか。

ご教示いただければ幸いです。

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

「いいね!」 5

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

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

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

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