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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
mahiguch
March 27, 2019
Programming
2.5k
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
80
WebView認証連携
mahiguch
0
87
メディアアプリLIMIAにおけるプッシュ通知配信システム
mahiguch
0
120
公式部活動技術書典部の活動紹介
mahiguch
0
140
エンジニア以外の方が自らSQLを使ってセグメント分析を行うカルチャーをどのように作っていったか
mahiguch
1
1.1k
PHPからgoへの移行で分かったこと
mahiguch
2
4.4k
BigQueryを使った機械学習プロジェクトの分析とオフライン検証
mahiguch
2
1.3k
gRPCを使ったメディアサービス2
mahiguch
0
250
LIMIAでのBigQuery活用事例
mahiguch
0
230
Other Decks in Programming
See All in Programming
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
190
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
110
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
260
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
Honoでのサプライチェーン侵害対策 〜 3つのライブラリに学ぶ
yusukebe
7
1.8k
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.4k
どこまでゆるくて許されるのか
tk3fftk
0
480
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
310
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.8k
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.9k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Building the Perfect Custom Keyboard
takai
2
810
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
230
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
Git: the NoSQL Database
bkeepers
PRO
432
67k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
380
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Into the Great Unknown - MozCon
thekraken
41
2.6k
Typedesign – Prime Four
hannesfritz
42
3.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
420
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なものが増えている可能性が あるので注意
ご静聴、ありがとうございました!