Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/web/app/(marketing)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { redirect } from 'next/navigation';
import { cookies } from 'next/headers';
import { Footer } from '@profullstack/footer/react';
import Script from 'next/script';
import { AdUnit } from '../../components/ad-unit';
import { BrandLockup, BrandWordmark } from '../../components/brand';

export const dynamic = 'force-dynamic';
Expand Down Expand Up @@ -36,7 +35,6 @@ export default async function LandingPage() {
<div>
<SiteNav />
<Hero />
<AdUnit />
<EvidenceSection />
<CapabilitiesSection />
<IdeasSection />
Expand Down
8 changes: 1 addition & 7 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@
}
.cp-ad[data-cp-filled] {
height: auto;
margin: 32px auto;
}
.cp-ad[data-cp-filled][data-format='banner_728x90'] {
min-height: 106px;
}
.cp-ad[data-cp-filled][data-format='banner_300x250'] {
min-height: 266px;
margin: 8px auto;
}
.cp-ad[data-cp-filled][data-format='text_link'] {
min-height: 40px;
Expand Down
13 changes: 4 additions & 9 deletions apps/web/components/ad-unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import { useEffect, useRef } from 'react';
import { usePathname } from 'next/navigation';

/**
* One CrawlProof ad unit, under the hero of the public landing page.
* One low-profile CrawlProof ad unit (the text_link line). Not used on the
* homepage, which carries no ad.
* Manage the slot at https://crawlproof.com/ads/slots
*/
const AD_SLOT = '121bb0bc-5e2e-4056-beeb-3c5166283991';

/** Account, auth and checkout pages carry no ad. */
const EXCLUDED_PREFIXES = ['/login', '/join', '/verify', '/reset', '/forgot'];

/** 728x90 needs the full row; anything narrower gets the 300x250 rectangle. */
const LEADERBOARD_QUERY = '(min-width: 768px)';

const SCAN_RETRY_MS = 200;
const SCAN_MAX_TRIES = 25;

Expand Down Expand Up @@ -43,11 +41,8 @@ function AdSlot() {
const el = ref.current;
if (!el) return;
// The server renders the element without data-slot, so ad.js's own
// DOMContentLoaded pass skips it; the format is chosen here from the real
// viewport and the unit fills exactly once.
el.dataset.format = window.matchMedia(LEADERBOARD_QUERY).matches
? 'banner_728x90'
: 'banner_300x250';
// DOMContentLoaded pass skips it; the unit fills exactly once.
el.dataset.format = 'text_link';
el.dataset.slot = AD_SLOT;

// ad.js scans once at DOMContentLoaded and may not have loaded yet, so
Expand Down
Loading