feat: AdMob向けのapp-ads.txtをFirebase Hostingで配信する - #329
Merged
Merged
Conversation
App Storeのマーケティングリンク(デベロッパーのウェブサイト)をHostingの ルートに向けるため、これまで404だった `/` に紹介ページを置く。 app-ads.txtのクローラーはこのURLのドメインを起点にファイルを探す。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
app-ads.txtのクローラーはApp Store掲載情報のマーケティングURLから デベロッパーのウェブサイトのドメインを特定するため、空のままだと app-ads.txtを見つけられない。本番Hostingのルートを指定する。 反映にはsync-metadataワークフローの手動実行が必要。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
配信先としてFirebase Hosting・GitHub Pages・独自ドメインを比較した経緯を ADR-0028に、設置と更新の手順をdoc/app_ads_txt.mdに残す。 本番反映にHostingとメタデータ同期の両方の手動実行が必要な点を明記する。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
未設置だとAdMobの広告在庫が認証されていないものとして扱われ、入札に 参加しないバイヤーが出る。クローラーはマーケティングリンクのドメインの ルート直下しか見ないため、Hostingのpublic直下に置く。 app-ads.txtは公開前提のファイルなのでxcconfigのようなgitignore扱いには せず、変更をレビューできるようリポジトリにコミットする。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
経緯
close #325
AdMobの広告在庫を「認証済み」として扱ってもらうには、IAB Tech Labの app-ads.txt をアプリストア掲載情報に記載したデベロッパーのウェブサイトのドメインのルート直下に置く必要がある。未設置のままだと認証されていない在庫と見なされ、入札に参加しないバイヤーが出て広告収益が目減りする。
調べたところ、設置に必要な前提が2つとも欠けていた。
https://stotic-dev.github.io/homete_iOS/)と Firebase Hosting の2つあるが、どちらにも app-ads.txt がないfastlane/metadata/ja/marketing_url.txt)が空実装内容
配信先に Firebase Hosting を選んだ理由
比較検討の経緯は ADR-0028 に記録した。要点は以下。
github.ioは Public Suffix List に載っているためルートはstotic-dev.github.ioになり、app-ads.txt を置くには別途ユーザーサイトのリポジトリを作る必要があって、このリポジトリの外に管理対象が増えるweb.appも Public Suffix なのでhomete-ios-dev.web.app自体がルートドメイン扱いになり、/app-ads.txtで要件を満たす。すでにfirebase/hosting/でAASAと招待リンクの着地ページを配信していて、deploy-hosting.ymlのデプロイ導線も揃っているため追加で運用するものが増えないHosting のルートに紹介ページを新設した理由
マーケティングリンクは App Store の製品ページで「デベロッパーのウェブサイト」としてユーザーに見えるリンクになる。Hosting のルート
/はこれまで/invite/**と/.well-known/しか無くて404だったため、そのまま向けるとユーザーがエラーページに着地してしまう。/を GitHub Pages にリダイレクトする案(firebase.json に1行足すだけ)も検討したが、クローラーがデベロッパーサイトのリダイレクト先ドメインを見に行った場合に app-ads.txt を見つけられなくなるリスクがあるため、実体のあるページを置く方を選んだ。デザイントークンは招待ページ(invite/index.html)と揃えている。app-ads.txt をコミットする理由
AdMobのアプリIDや広告ユニットIDは
Secret.xcconfigとしてgitignoreしているが、app-ads.txt は第三者に公開して読ませることが目的のファイルなので同じ扱いにはしない。リポジトリに入れて変更をPRのレビュー対象にする。内容は標準の
DIRECT1行のみ(メディエーションを使っていないため)。確認内容
コード変更なし(Hostingの静的ファイル・App Store Connectのメタデータ・ドキュメントのみ)のため、ビルド・ユニットテストは実行していない。
curl -i https://homete-ios-dev-e3ef7.web.app/app-ads.txtが 200 /Content-Type: text/plainを返し、google.com, pub-..., DIRECT, f08c47fec0942fa0が入っていることhttps://homete-ios-dev-e3ef7.web.app/が紹介ページを表示し、利用規約・プライバシーポリシー・App Storeへのリンクが正しく開くこと(ライト/ダーク両方)/invite/<token>)とAASAの配信が、ルートへのindex.html追加で壊れていないことマージ後に必要な手動作業
手順は doc/app_ads_txt.md にまとめた。どれかを忘れるとクローラーに届かない。
deploy-hosting.ymlをworkflow_dispatch/environment=prodで実行する(STGはmainマージで自動)sync-metadata.ymlをworkflow_dispatchで対象バージョンを指定して実行し、マーケティングリンクをApp Store Connectへ同期する(反映に最大24時間)🤖 Generated with Claude Code