Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Firestoreを使って純広告配信機能を作った話
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
mahiguch
March 27, 2019
Programming
4
2.4k
Firestoreを使って純広告配信機能を作った話
potatotips #60 (iOS/Android開発Tips共有会)のLT資料です。
https://potatotips.connpass.com/event/123002/
mahiguch
March 27, 2019
Tweet
Share
More Decks by mahiguch
See All by mahiguch
爆速で成長する おでかけ情報サービスの成長を支えるデザインと開発の取り組みについて
mahiguch
0
57
WebView認証連携
mahiguch
0
76
メディアアプリLIMIAにおけるプッシュ通知配信システム
mahiguch
0
110
公式部活動技術書典部の活動紹介
mahiguch
0
120
エンジニア以外の方が自らSQLを使ってセグメント分析を行うカルチャーをどのように作っていったか
mahiguch
1
1.1k
PHPからgoへの移行で分かったこと
mahiguch
2
4.2k
BigQueryを使った機械学習プロジェクトの分析とオフライン検証
mahiguch
2
1.2k
gRPCを使ったメディアサービス2
mahiguch
0
230
LIMIAでのBigQuery活用事例
mahiguch
0
220
Other Decks in Programming
See All in Programming
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
720
AgentCoreとHuman in the Loop
har1101
5
210
CSC307 Lecture 05
javiergs
PRO
0
490
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
140
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
180
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
14
4.6k
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.2k
Fluid Templating in TYPO3 14
s2b
0
120
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
170
dchart: charts from deck markup
ajstarks
3
990
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
0
830
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
What's in a price? How to price your products and services
michaelherold
247
13k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
110
The SEO identity crisis: Don't let AI make you average
varn
0
62
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Site-Speed That Sticks
csswizardry
13
1.1k
Un-Boring Meetings
codingconduct
0
200
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
920
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Transcript
Firestoreを使って純広告配信機能 を作った話
Masahiro Higuchi / 樋口雅拓 • グリーグループのリミア株式会社で、LIMIA という住まい領域のメディアを 作っています。ゲーム会社ですが、最近はメディアに力を入れています。 • 機械学習のエンジニアですが、iOS,
Android,JSなどもやっている何でも屋 です。4歳の娘のパパ。twitter: @mahiguch1 • https://limia.jp/ • https://arine.jp/ • https://aumo.jp/ • https://moguna.com/ • https://www.mine-3m.com/mine/
Firestoreの説明
Firestoreとは? • FirestoreはFirebaseの機能の一つ。Document Databaseと呼ばれるも の。2019年1月31日にGAになった。 • SDKがあり、iOS/Androidから直接アクセス可能。 • データの入力はFirebase管理画面から可能。 —>
つまり、アプリ実装のみで、ClientServer型のシステムを構築できる!
Firestoreのモデル • Document DatabaseとはNoSQLの一種。 • OracleやMySQLといったRDBでは事前にSchemaを定義しておくが、Document Databaseで は後から自由に変更できる。 jsonをそのまま格納できるイメージ。 •
データはDocumentという場所に格納され、それが Collectionでまとめられている。 • 分かりやすくMySQLで例えると、Collectionがテーブル、Documentがレコード。 —> 正直分かりづらいと思うので、画面とコードを見ながら説明していきます!
Firestoreへのデータ入力方法 • 左: コレクション • 中: ドキュメント • 右: ドキュメントの中身
管理画面があるので、ここから 入力できる。
Firestoreからのデータ取得方法 Collectionと Documentを指 定することで取得 可能。
Firestoreから複数データ取得方法 SQLのように whereで絞り込み が可能
自作した純広告配信機能の説明
純広告 is 何? • 自社で販売している広告商品 • AdNet経由で流れてくる広告と区別するためにこう呼んでいる • 表示回数やクリック数を保証しているので、それを達成する必要がある。 •
関東在住40代男性のような絞り込みをかける必要がある
ターゲティングはUserPropertyxRemoteConfig • ユーザの所在地、年齢、性別の推定情報などを UserPropertyに設定する。 • それを使ってRemoteConfigで細かく制御 • 条件に一致していた場合true、それ以外の場合falseを返すようにする。
その情報を取得する documentSnapshotsには、掲載枠で絞り込んだ全案件が入っています。 それをObjectにして、配信比率で絞り込み、制約条件でも絞り込みます。 残った候補の中からランダムに 1つを掲載します。 制約条件に一致しているかどうかは、 RemoteConfigから取得した値で判定しています。
罠: バージョンアップでnullableになる バージョンアップすると、取得したドキュメントがnullableになっていった。GAに なったので、もう無いと思いますが。。。
まとめ • Firestoreを使うと、アプリだけでClientServerシステムができる。 • UserProperty x RemoteConfigと組み合わせると、色々できそう。 • Firestoreはバージョンアップするとnullableなものが増えている可能性が あるので注意
ご静聴、ありがとうございました!