Skip to content

Instantly share code, notes, and snippets.

@aik0aaac
Last active June 1, 2023 16:59
Show Gist options
  • Save aik0aaac/d19a1e3f440f8ce6eea02e9a000153b8 to your computer and use it in GitHub Desktop.
Save aik0aaac/d19a1e3f440f8ce6eea02e9a000153b8 to your computer and use it in GitHub Desktop.
Youtube Analytics APIで定義されている全ての`filter`内容。(TypeScript)
import { DimensionMaster } from "./dimensionMaster";
/**
* Youtube Analytics API > `query`内で指定可能なフィルター一覧。
* 公式Docs: https://developers.google.com/youtube/analytics/dimensions
*
* ディメンションの値をそのまま使用可能。
* さらにフィルターでしか使用できない値があり、当ファイルにて定義。
*/
export const FilterMaster = {
core: {
...DimensionMaster.core,
/**
* Youtube分析用グループID。
* 使用すると、レスポンスにはグループに含まれる全ての「動画」「再生リスト」「チャンネル」が返却される。
*/
group: "group",
},
geographicAreas: {
...DimensionMaster.geographicAreas,
/**
* 国連の統計上地域コード。
* 以下の値のみサポート:
* - `002`: アフリカ
* - `019`: アメリカ大陸(北アメリカ、ラテンアメリカ、南アメリカ、カリブ海)
* - `142`: アジア
* - `150`: ヨーロッパ
* - `009`: オセアニア
*/
continent: "continent",
/**
* 国連の統計上地域サブコード。
* 対応値例: `030`: 東アジア
* その他の値は公式Docsをチェック。
*/
subContinent: "subContinent",
},
timePeriods: {
...DimensionMaster.timePeriods,
},
playbackLocations: {
...DimensionMaster.playbackLocations,
},
playbackDetails: {
...DimensionMaster.playbackDetails,
},
trafficSource: {
...DimensionMaster.trafficSource,
},
device: {
...DimensionMaster.device,
},
gender: {
...DimensionMaster.gender,
},
engagementAndContentSharing: {
...DimensionMaster.engagementAndContentSharing,
},
audienceRetention: {
...DimensionMaster.audienceRetention,
/**
* レポートデータに関連づけられたトラフィック種別。
* 以下の値をサポート:
* - `ORGANIC`
* - `AD_INSTREAM`
* - `AD_INDISPLAY`
*/
audienceType: "audienceType",
},
adPerformance: {
...DimensionMaster.adPerformance,
},
playlist: {
/**
* リクエストが再生リストのコンテキスト内で発生した動画ビューに関するデータを取得していることを示す。
* 再生リストレポートには必ず必要、値は`1`を指定。
*/
isCurated: "isCurated",
},
onlyContentOwner: {
...DimensionMaster.onlyContentOwner,
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment