questionnaire docs
Ads

Theme Ad Timing

When each ad type starts loading based on theme configuration.

Theme Ad Timing

Ad start timing is controlled by components/utils/themeConfig.js via shouldStartAd() and shouldEnableAd().

Timing constants

ConstantMeaning
themeVisibleStart when theme overlay appears
themeClosedStart after theme overlay closes
contentVisibleStart when content phase is visible
alwaysStart immediately on page mount
rewardedAdCtaClickStart when user clicks rewarded CTA

Full timing matrix

Ad TypeQuestionnaireWhatsAppGuideGuide2Nothing
DisplaythemeVisiblethemeVisiblethemeVisiblethemeClosedalways
InterstitialthemeVisibleCTA clickthemeVisiblethemeClosedalways
SkyscraperthemeClosedthemeClosedthemeVisiblethemeClosedalways
StickyCTA clickthemeClosedthemeVisiblethemeClosedalways
Rewarded loadthemeVisiblethemeVisiblecontentVisiblecontentVisiblealways
Rewarded triggerCTACTACTA (popup)CTA (popup)CTA

State machine

Hooks

HookFilePurpose
useAdThemeTimingcomponents/hooks/useAdThemeTiming.jsWraps shouldEnableAd + shouldStartAd
useAdDelayscomponents/hooks/useAdDelays.jsComputes delay timers per ad type

Enabled ads per theme

ThemeDisabled ad types
All except nothingNone (all 5 types enabled)
nothingInterstitial disabled

How components use timing

// Simplified pattern in ad components
const { isAdEnabled, shouldRender } = useAdThemeTiming(
  AD_TYPES.DISPLAY,
  themeType,
  { themeClosed, contentVisible, rewardedAdTriggered }
);

if (!shouldRender) return null;
return <DisplayAd ... />;

On this page