On this page
What this issue is
Before a browser can download a file from another domain, it has to do three things: look up the domain (DNS), open a connection (TCP) and secure it (TLS). This is called connection setup. It can take a noticeable fraction of a second, especially on mobile networks.
A preconnect hint is a line in your page <head> that tells the browser to do this setup early. If it is missing, the browser only starts the setup once it reads the CSS or HTML that mentions the file. Typical origins that need it are https://fonts.gstatic.com (Google Fonts files), your image CDN, or a font host such as Adobe Fonts.
Why it costs you leads or sales
Slow connection setup pushes back the moment your headline and hero image appear. Largest Contentful Paint (LCP) is the time until the biggest visible element has loaded. Visitors who see a blank or unstyled page for longer are more likely to leave before they reach your form or buy button.
The effect is usually small, often a few hundred milliseconds. It adds up with other delays on paid landing pages, where each lost visitor is a click you paid for.
- HTML arrivesBrowser reads the head
- CSS requests a fontThird-party origin discovered late
- DNS + TCP + TLSConnection setup starts only now
- Font downloadsText renders late
- LCPLargest element appears later
Without preconnect, connection setup to the font host starts only after the CSS is parsed.
Example: illustrative numbers on a mid-range mobile connection. Real savings depend on the network and the host.
How to check if your site has it
List third-party origins
Open your page in Chrome, press F12, go to the Network tab, reload and sort by Domain. Note the origins that serve fonts, CSS, or your hero image.
Look at the head
Right-click, choose View page source and search for
rel="preconnect". Compare the list with the origins you noted.Run Lighthouse
In Chrome DevTools open the Lighthouse tab and run a Performance report. Look for the audit named 'Preconnect to required origins' (it may appear as a diagnostic).
Use a waterfall
In a tool such as WebPageTest, check whether the third-party request shows DNS, connect and SSL bars right before the file download. Those bars are the delay a preconnect hides.
How to fix it
Add a preconnect tag near the top of the <head>, before the stylesheets that use the origin. Keep it to the origins that serve critical, above-the-fold files. Too many hints compete for bandwidth and can slow the page.
<head>
<meta charset="utf-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://cdn.example.com">
<!-- stylesheets follow -->
</head>Use a performance plugin if you have one
Some optimisation plugins have a 'Preconnect' or 'Resource hints' setting. Add your origin there.
Or add it in code
In a child theme's functions.php, hook
wp_resource_hintsorwp_headat priority 1 and output the link tags. Avoid editing the parent theme, as updates overwrite it.Check for duplicates
Some themes already add hints for Google Fonts. View source and remove repeats.
Open the theme code
Go to Online Store, Themes, the three-dot menu, Edit code, and open layout/theme.liquid.
Paste the tags
Add the link tags high in the
<head>. Shopify's own CDN (cdn.shopify.com) is often already hinted by the theme, so check first.Save and preview
Test the page and view source to confirm the tags are present.
Prefer the page source
Preconnect works best when it is in the HTML head. A tag injected by GTM runs late, so it helps little for fonts and the hero image.
Only use it for late third-party scripts
If you must, use a Custom HTML tag on the All Pages trigger that adds the link element, but expect a smaller gain.
Open project settings
Go to Project settings, Custom code, and find the Head code box.
Paste the link tags
Add the preconnect lines, then publish the site.
Check Google Fonts usage
If you use Webflow's built-in font picker, Webflow may already handle the connection. View source after publishing to see what is there.
Open funnel or page settings
In the funnel or website builder, open Settings and find Head tracking code or Custom code.
Paste the link tags
Add the preconnect lines and save. Publish and view source to confirm they appear in the head.
Check what is possible
Wix manages most resource loading itself. You can add custom code under Settings, Custom code, set to the Head, but you cannot control the order of Wix's own requests.
Add only if needed
Add a preconnect only for a third-party origin you added yourself, such as an external font or image host.
Open Code Injection
Go to Website, Pages, Custom Code, Code Injection (a Business plan or higher is needed for code injection).
Paste into the Header box
Add the link tags and save. Squarespace handles its own fonts, so hint only external origins you added.
Edit your base template
Add the link tags to the shared layout so every page gets them, placed before stylesheets.
Or send an HTTP header
You can also send
Link: <https://cdn.example.com>; rel=preconnectfrom your server or CDN. Usecrossoriginin the header value for fonts.
How to confirm it's fixed
- View source shows each
rel="preconnect"tag in the head, before the stylesheets. - Font hosts have the
crossoriginattribute. - In the DevTools Network waterfall, the third-party request no longer shows a long DNS/connect/SSL stage before download.
- Lighthouse no longer lists the origin under 'Preconnect to required origins'.
- You have no more than a few preconnect tags, and none for origins the page does not use.
- The page still looks and works the same on mobile.
How to prevent it happening again
Resource hints go stale. When you change font provider, switch CDN or remove a script, the old tag stays and the new origin has none. Keep these habits:
- Review preconnect tags whenever you change fonts, CDN or theme.
- Remove hints for origins you no longer use.
- Run Lighthouse or PageSpeed Insights after each major template change.
- Keep the hint list short, only for origins used above the fold.
- Record the reason for each hint in a code comment.
How FunnelGuard handles this
This issue is outside what FunnelGuard checks. FunnelGuard runs your real customer journeys (forms, checkouts, booking and chat buttons), the tracking hits and test lead delivery. It does not audit resource hints in your page head.
The kind of tool that fits is a page speed or web performance testing tool, such as Lighthouse, PageSpeed Insights or WebPageTest, which shows connection timing and lists missing preconnect hints. Use FunnelGuard alongside it to check that your forms, checkouts and tracking still work after you change your page head.
Questions people ask
What does preconnect do?
Preconnect tells the browser to open a connection to another domain before it needs a file from it. That means DNS lookup, TCP connection and TLS setup happen early, so the file can start downloading as soon as the page asks for it.
Why does preconnect for Google Fonts need crossorigin?
Font files are fetched in anonymous CORS mode. A preconnect without the crossorigin attribute creates a connection that font requests cannot reuse. Add crossorigin to the fonts.gstatic.com hint.
How many preconnect hints should I use?
Use as few as possible, usually one to three, for origins that serve critical above-the-fold files. Each hint uses CPU and network at the start of the page load, so too many can slow things down.
Does preconnect improve LCP?
It can, when your hero image or a font loads from another origin, because it removes the connection setup from the critical path. The gain is usually small. It does nothing if all your files are on your own domain.
What is the difference between preconnect and dns-prefetch?
Dns-prefetch only resolves the domain name. Preconnect also opens the TCP and TLS connection, so it saves more time. Dns-prefetch is a lightweight fallback for older browsers or for origins you may use later.
Where do I put the preconnect tag?
Put it in the <head>, as high as possible and before the stylesheets or scripts that request files from that origin. A tag added late by JavaScript or a tag manager helps much less.
Do I need preconnect if I self-host my fonts?
No. Self-hosted fonts come from your own domain, which the browser is already connected to. You may still want a hint for an external image CDN or other third-party origin that serves critical files.
Can FunnelGuard tell me if preconnect is missing?
No. This is outside what FunnelGuard checks. Use a page speed tool such as Lighthouse, PageSpeed Insights or WebPageTest for that.
Related issues
- PRF-001LCP over 2.5 s on a funnel stepFix guide
- PRF-002LCP over 4 s on mobile (poor) on the paid landing pageFix guide
- PRF-008LCP image not preloaded / no fetchpriority=highFix guide
- PRF-010Hero background image set in CSS, discovered lateFix guide
- PRF-011Render-blocking CSS in <head> (large theme stylesheets)Fix guide
- PRF-022Too many preconnect/preload hints competing for bandwidthFix guide