Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR integrates Google AdSense into the SurfSense free hub page. It adds environment configuration for AdSense credentials, creates reusable ad script and unit components with safety guards, integrates them into the free hub page at two placements, and adds the ads.txt publisher verification file. ChangesGoogle AdSense Integration
Sequence DiagramsequenceDiagram
participant Page as Free Hub Page
participant AdSenseScript as AdSenseScript
participant AdUnit as AdUnit
participant GoogleAPI as Google AdSense API
Page->>AdSenseScript: Mount AdSenseScript
AdSenseScript->>GoogleAPI: Load script (if client ID set)
Page->>AdUnit: Mount AdUnit (slot A)
AdUnit->>AdUnit: Check data-adsbygoogle-status
AdUnit->>GoogleAPI: Push to window.adsbygoogle
GoogleAPI->>AdUnit: Render ad (with error handling)
Page->>AdUnit: Mount AdUnit (slot B)
AdUnit->>AdUnit: Check data-adsbygoogle-status
AdUnit->>GoogleAPI: Push to window.adsbygoogle
GoogleAPI->>AdUnit: Render ad (with error handling)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR integrates Google AdSense into the
/freepage by adding a reusable ad component system. The implementation includes three new components (AdSenseScript,AdUnit, and centralized slot configuration), environment variable configuration for the AdSense client ID and slot IDs, and places two ad units on the free hub page (one above the model table and one before the FAQ section). The ads are fully optional and controlled by environment variables, allowing them to be disabled by leaving the configuration empty.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/public/ads.txtsurfsense_web/.env.examplesurfsense_web/components/ads/adsense-config.tssurfsense_web/components/ads/adsense-script.tsxsurfsense_web/components/ads/ad-unit.tsxsurfsense_web/app/(home)/free/page.tsxSummary by CodeRabbit
Release Notes