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
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
72
WebView認証連携
mahiguch
0
86
メディアアプリLIMIAにおけるプッシュ通知配信システム
mahiguch
0
110
公式部活動技術書典部の活動紹介
mahiguch
0
130
エンジニア以外の方が自らSQLを使ってセグメント分析を行うカルチャーをどのように作っていったか
mahiguch
1
1.1k
PHPからgoへの移行で分かったこと
mahiguch
2
4.3k
BigQueryを使った機械学習プロジェクトの分析とオフライン検証
mahiguch
2
1.3k
gRPCを使ったメディアサービス2
mahiguch
0
250
LIMIAでのBigQuery活用事例
mahiguch
0
230
Other Decks in Programming
See All in Programming
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
310
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
330
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
18
7.6k
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.4k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
2.4k
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.2k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
260
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
Modding RubyKaigi for Myself
yui_knk
0
830
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
550
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
110
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Practical Orchestrator
shlominoach
191
11k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
Measuring & Analyzing Core Web Vitals
bluesmoon
9
850
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
230
Scaling GitHub
holman
464
140k
Believing is Seeing
oripsolob
1
140
Documentation Writing (for coders)
carmenintech
77
5.4k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
200
The browser strikes back
jonoalderson
0
1.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
130
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なものが増えている可能性が あるので注意
ご静聴、ありがとうございました!