Skip to content

feat(disney): add featured offer slot with outbound tracking#972

Open
falgon wants to merge 5 commits into
developfrom
feature/disney-offer-foundation
Open

feat(disney): add featured offer slot with outbound tracking#972
falgon wants to merge 5 commits into
developfrom
feature/disney-offer-foundation

Conversation

@falgon

@falgon falgon commented Feb 23, 2026

Copy link
Copy Markdown
Owner

概要

  • disney_experience_summary に送客導線の基盤を追加
  • 記事ごとの表示ではなく、一覧タブ上部に 1 枠の集約PRスロットを実装
  • 送客リンクは disney_experience_summary/go/index.html?offer=<offerId> 経由で遷移し、UTMを付与
  • offer_click を GA4 (gtag) イベントとして送信

主な変更

  • contents/config/disney/Offers.dhall を追加(オファー定義)
  • src/Rules/DisneyExperienceSummary.hs
    • Offers.dhall の読み込みと offerId / offerUrl の設定検証
    • featured offer HTML の生成
    • 単一の送客リダイレクトページ生成(go/index.html?offer=<offerId>
    • allowlist 済み HTTPS URL のみを送客先に採用
    • UTM パラメータの重複除去と percent encoding
  • contents/pages/disney_experience_summary/jp.html
    • 一覧上部に featured-offer-slot を追加
  • contents/scss/disney_experience_summary_only.scss
    • featured offer 用スタイルを追加(モバイル対応含む)
  • contents/ts/disney-tag-filter.ts
    • .offer-link クリック時に offer_click を計測
  • contents/ts/__tests__/disney-tag-filter.test.ts
    • offer click tracking テストを追加

動作確認

  • make format
  • stack build
  • make check(既存 warning のみ)
  • make test
  • stack exec site -- clean && stack exec site -- build
  • stack exec site -- check --internal-links
  • 生成結果確認: docs/disney_experience_summary/jp.html に featured offer が描画され、リンクが go/index.html?offer=<offerId> になることを確認
  • 生成結果確認: docs/disney_experience_summary/go/index.html の送客先 URL に UTM が付与されることを確認

備考

  • 表示確認用にサンプルオファーを 1 件追加しています

Refs: #954, #957, #958, #959, #960, #961

@github-actions

github-actions Bot commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 28.97% 605 / 2088
🔵 Statements 28.96% 623 / 2151
🔵 Functions 31.36% 117 / 373
🔵 Branches 20.53% 214 / 1042
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
contents/ts/disney-tag-filter.ts 29.49% 26.1% 25.19% 29.59% 23-537, 572, 589-590, 597, 599, 600, 606-614, 638-644, 661, 674, 685-692, 696-701, 707, 723, 731, 743, 753, 756-772, 804, 816, 832-842, 846, 859, 871-872, 885-887, 903-905, 914, 917, 920-922, 943, 947, 952-953, 958-960, 965-967, 973-979, 984-990, 1000, 1006, 1030-1040, 1050-1060, 1072-1090, 1102-1104, 1115-1128, 1163-1329
Generated in workflow #943 for commit a6d9ff1 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Haskell Test Coverage Report

Generating combined coverage report.
Summary combined coverage report:
 78% expressions used (1005/1287)
 55% boolean coverage (5/9)
      50% guards (3/6), 3 always True
      66% 'if' conditions (2/3), 1 always True
     100% qualifiers (0/0)
 77% alternatives used (34/44)
 67% local declarations used (38/56)
 50% top-level declarations used (126/251)
The combined coverage report is available at
/Users/runner/work/roki-web/roki-web/.stack-work/install/aarch64-osx/c8bd8cc889b4268cdf5e7d0b073c5450e5447f77efaf84c8174147ae1a288879/9.6.6/hpc/combined/custom/hpc_index.html.

Generated by stack hpc report

@kiirotori

Copy link
Copy Markdown
Collaborator

more info

  • ☁️ Storage Free space 2.01 GiB 13.43%
  • 📂 0 B CI_WORK/GitHubActions/roki-web

@falgon

falgon commented Feb 23, 2026

Copy link
Copy Markdown
Owner Author

運用メモとして、実案件反映時に必要な作業を追記する

対応方法

  1. contents/config/disney/Offers.dhall を案件ごとに更新

    • offerId を一意にする
    • offerUrl を実際の遷移先URLにする
    • offerTitle / offerCtaLabel / offerDescription を案件内容に合わせる
    • 掲載対象は offerIsActive = True にする
    • 必要に応じて offerUtmCampaign を設定(未設定時は offer_<offerId>
  2. contents/config/disney/OfferDeliveryPolicies.dhall を更新

    • policyOfferIdOffers.dhallofferId と一致させる
    • 同一提携先のオファーは policyPartnerId を同じ値にする(公平性計算の単位)
    • policyTargetShare / policyMinShare / policyMaxShare を提携条件に合わせて設定
    • 初期値として policyHistoricalImpressions / policyHistoricalClicks を必要なら投入
  3. 計測前提の確認

    • gtag が有効な環境で offer_click が送信されることを確認
    • 送信パラメータ: offer_id, offer_title, offer_partner_id, offer_placement, page_path, outbound_url
  4. 反映

    • 設定変更後に通常どおりビルド/デプロイ

必要であれば、次PRで OfferDeliveryPolicies.dhall のテンプレを複数提携先向けに拡張します。

@kiirotori

Copy link
Copy Markdown
Collaborator

more info

  • ☁️ Storage Free space 1.52 GiB 10.13%
  • 📂 0 B CI_WORK/GitHubActions/roki-web

@kiirotori

Copy link
Copy Markdown
Collaborator

more info

  • ☁️ Storage Free space -4030932198 B -25.03%
  • 📂 382.11 MiB CI_WORK/GitHubActions/roki-web

@kiirotori

Copy link
Copy Markdown
Collaborator

more info

  • ☁️ Storage Free space 7.36 GiB 49.06%
  • 📂 132.27 MiB CI_WORK/GitHubActions/roki-web

@kiirotori

Copy link
Copy Markdown
Collaborator

more info

  • ☁️ Storage Free space 6.83 GiB 45.52%
  • 📂 132.27 MiB CI_WORK/GitHubActions/roki-web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants