src/hooks/google-ads.tsximport Script from 'next/script'type GoogleAdsProps = {adId: stringloadGtagJs?: boolean // Optional flag to skip duplicate gtag.js load}export default function GoogleAds({ adId, loadGtagJs = true }: GoogleAdsProps) {if (!adId) return nullreturn (<>{loadGtagJs && (<Scriptsrc={`https://www.googletagmanager.com/gtag/js?id=${adId}`}strategy="afterInteractive"/>)}<Scriptid="google-ads-config"
Showing the first 20 lines.
Get full code