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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mahiguch
March 27, 2019
Programming
2.5k
4
Share
Firestoreを使って純広告配信機能を作った話
potatotips #60 (iOS/Android開発Tips共有会)のLT資料です。
https://potatotips.connpass.com/event/123002/
mahiguch
March 27, 2019
More Decks by mahiguch
See All by mahiguch
爆速で成長する おでかけ情報サービスの成長を支えるデザインと開発の取り組みについて
mahiguch
0
70
WebView認証連携
mahiguch
0
85
メディアアプリLIMIAにおけるプッシュ通知配信システム
mahiguch
0
110
公式部活動技術書典部の活動紹介
mahiguch
0
130
エンジニア以外の方が自らSQLを使ってセグメント分析を行うカルチャーをどのように作っていったか
mahiguch
1
1.1k
PHPからgoへの移行で分かったこと
mahiguch
2
4.3k
BigQueryを使った機械学習プロジェクトの分析とオフライン検証
mahiguch
2
1.2k
gRPCを使ったメディアサービス2
mahiguch
0
240
LIMIAでのBigQuery活用事例
mahiguch
0
220
Other Decks in Programming
See All in Programming
空間オーディオの活用
objectiveaudio
0
150
AgentCore Optimizationを始めよう!
licux
3
230
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
770
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
400
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
240
AIを導入する前にやるべきこと
negima
2
340
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
340
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
140
Building on Bluesky's AT Protocol with Ruby
mackuba
0
110
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
680
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
170
Discover your Explorer Soul
emna__ayadi
2
1.1k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Claude Code のすすめ
schroneko
67
220k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
Docker and Python
trallard
47
3.8k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
550
Code Review Best Practice
trishagee
74
20k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
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なものが増えている可能性が あるので注意
ご静聴、ありがとうございました!