Skip to main content

Popup is lowering my site speed or PageSpeed score

Your popup often shows up in PageSpeed screenshots because it's visible on the page, but that doesn't mean it's lowering your score. This article walks you through testing whether your popup is the cause, then fixing the 2 issues a popup can create.

Written by Rob D

If PageSpeed Insights or Lighthouse flags your Alia popup for a slow Largest Contentful Paint (LCP) or Cumulative Layout Shift (CLS), use this guide to confirm the cause and fix it.

Issue

You test your store in PageSpeed Insights, Lighthouse, or a similar tool and see one or more of the following:

  • Your performance score is low, and a screenshot in the report shows your Alia popup.

  • The report names an image or text from your popup as the Largest Contentful Paint element.

  • The report lists a layout shift (CLS) involving your popup or floating button.

  • A developer, agency, or consultant has told you your popup is slowing down your site.

Environment

  • Any Alia campaign that shows an overlay popup or a floating button.

  • Most common in mobile reports, which PageSpeed Insights shows by default.

  • Most common on popups that open on a time delay and include a large image.

Resolution

Check whether your popup is the cause

Test the same page with your popup on and off.

  1. Enter the URL of the page with the warning and select Analyze.

  2. Note your performance score, LCP, and CLS.

  3. In Alia, go to Campaigns and turn off the campaign that shows on that page.

  4. Run the same test again on the same page.

  5. Compare the results, then turn your campaign back on.

💡Tip: Scores can shift a few points between runs even when nothing has changed. Run each test 2 or 3 times and compare the averages.

Compare the individual metrics, not only the overall performance score. The score blends several measurements, so a single metric tells you more about what changed. Google rates each metric as good at these values:

Metric

Good

Largest Contentful Paint (LCP)

2.5 seconds or less

Interaction to Next Paint (INP)

200 milliseconds or less

Cumulative Layout Shift (CLS)

0.1 or less

If your results stay about the same, your popup isn't what's lowering your score. The Diagnostics section of the report lists the scripts and elements that are.

If your LCP or CLS improves noticeably with the campaign off, use the matching fix in the next sections.

Fix a slow LCP caused by your popup

Largest Contentful Paint (LCP) measures when the largest element on screen finishes loading. If your popup is larger than anything else on the page and opens on a time delay, testing tools can count the moment it opens as your LCP. Your page may have loaded quickly, but the score reflects when the popup appeared. To confirm, open the Largest Contentful Paint element item in your report. If it shows an image or text from your popup, this fix applies. Alia elements usually include alia in their name, such as alia-popup-root.

Try these fixes in order:

  1. Make your popup's largest image or text block smaller on screen than the largest image on your page, such as your hero or product image. Check your mobile layout too. Once your popup is no longer the largest element, LCP measures your page content instead.

  2. Upload lighter image files. Use WebP images, compress them, and size them close to how large they'll display. On its own, this usually won't fix LCP if your popup is still the largest element, but it helps your popup load faster.

  3. Change your popup's trigger to one that fires after a visitor interacts with the page, such as scroll depth, exit intent, or a button click. LCP stops being measured once a visitor scrolls, taps, or clicks, so a popup that opens after that can't become your LCP. See How to add a scroll depth trigger to your popup.

Changing your trigger changes when visitors see your popup, which can change your signup rate. Try the first 2 fixes before changing your trigger.

Fix layout shift (CLS) caused by your floating button

Cumulative Layout Shift (CLS) measures how much content moves around on the page unexpectedly. Your popup can add to CLS in one situation: your floating button appears before your overlay popup opens. When the popup opens, the button moves or disappears, and testing tools count that as a shift.

To fix this, set your floating button to appear only after your popup is closed, not before it opens. If your CLS stays the same with your campaign turned off, your popup isn't causing it. Check the layout shift items in your report's Diagnostics section to see which elements are.

Check a slow INP

Interaction to Next Paint (INP) measures how quickly your page responds when a visitor taps, clicks, or types. A slow INP usually comes from how long scripts take to run, not from how large a script file is. PageSpeed Insights only shows INP in field data from real visitors, so turning off your campaign won't change it right away. For a quick comparison, check Total Blocking Time in the lab results with your campaign on and off. It measures how long scripts keep the page from responding. If Total Blocking Time stays about the same, the delay is coming from your theme or another app. If it drops noticeably with your campaign off, reduce the work Alia repeats while visitors browse:

  • Pause live campaigns you aren't using. Alia keeps checking targeting for every live campaign on the page.

  • Use built-in targeting conditions instead of custom code conditions where you can. Alia rechecks campaigns that haven't matched yet about once a second, and custom code conditions are among the heaviest checks.

Taps on your popup count toward INP like taps anywhere else on your page. When a visitor closes or minimizes a popup, Alia hides it right away and finishes the rest of its work afterward, so the tap isn't kept waiting.

💡Note: Delaying Alia until a visitor interacts (see the next section) doesn't improve INP and can make it slightly worse, because Alia's startup work then happens right as visitors start interacting.

Delay Alia until a visitor interacts

If you're working to raise your PageSpeed or Lighthouse performance score, you can hold Alia back so it doesn't start when the page loads. Alia starts only once the visitor first scrolls, taps, clicks, moves the mouse, or presses a key. Lab tests like PageSpeed Insights and Lighthouse load your page without interacting with it, so Alia mostly drops out of those tests. This is an advanced option that needs a small code change to your theme. Read the tradeoffs below before you add it.

What changes when you delay Alia

  • Your analytics shift. Visitors who leave without interacting never load Alia, so your visitor and popup view counts go down, and your signup rate can look higher.

  • Time delays still count from page load. Your time delay counts from when the page started loading, not from when Alia starts. For example, a popup with a 5-second delay opens right away for a visitor who first interacts after 10 seconds. Exit intent and other triggers start listening only once Alia starts.

  • Custom code waits too. Any code on your site that works with Alia, such as SDK calls or listeners for Alia's events, only takes effect after the visitor's first interaction.

  • Previews need a nudge. When you check a popup on your live store, scroll or move your mouse before it appears.

  • INP doesn't improve. This only helps lab scores. Real-visitor data, including INP, stays the same or gets slightly worse.

Add the code to your Shopify theme

  1. In your Shopify admin, go to Online Store > Themes.

  2. Next to your current theme, select the … button, then Edit code.

  3. In the Layout folder, open theme.liquid.

  4. Paste the code below on a new line just above </head>.

  5. Select Save.

<script>
  window.ALIA_LAZY = true;
  (() => {
    const events = ["pointerdown", "keydown", "touchstart", "scroll", "wheel", "mousemove"];
    const start = () => {
      events.forEach((e) => window.removeEventListener(e, start));
      window.ALIA_LAZY = false;
      const init = () => window.ALIA_INIT?.();
      if (document.readyState !== "loading") setTimeout(init, 0);
      else document.addEventListener("DOMContentLoaded", init, { once: true });
    };
    events.forEach((e) => window.addEventListener(e, start, { passive: true }));
  })();
</script>

Paste the whole snippet, not only the first line. On its own, window.ALIA_LAZY = true stops Alia from starting at all, and the rest of the snippet is what starts it on the first interaction.

💡Tip: To try this safely, duplicate your theme first and add the code to the copy. Preview the copy, then publish it once you're happy. To turn delayed loading off, delete the snippet and save.

Reduce the number of files your popup loads

If your popup uses the same font as your site, you can tell Alia to reuse it instead of loading it again. This reduces the number of files your popup requests. See How to reuse fonts loaded on your site.

Cause

Testing tools take screenshots while your page loads. Because your popup is visible in those screenshots, it is often assumed to be the cause of a low score even when it isn't. The Alia script loads asynchronously, so your browser keeps building your page while the script downloads. Your popup affects your score in 2 specific cases:

  • A large popup element opens on a time delay and becomes your LCP.

  • Your floating button appears before your popup opens and causes a layout shift.

💡Note: PageSpeed Insights shows 2 kinds of results. Lab data comes from a single simulated test and updates right away. Field data comes from real Chrome visitors over the past 28 days, so it can take up to 28 days to reflect a change.

FAQ

Does the Alia script block my page from loading?

No. The Alia script loads asynchronously by default, so it doesn't pause your page from rendering. Your popup's trigger, such as a time delay, controls when the popup appears. That timing is separate from how the script loads.

Why do I see Alia requests in my report?

This is expected. Depending on your active campaigns, Alia makes a few requests to decide which campaign to show and whether a visitor has already received a reward. These requests run in the background and aren't expected to noticeably affect how quickly your page loads.

Why is the Alia script file so large?

The Alia script contains code for Alia's features. Larger features you haven't turned on are skipped, but some smaller ones stay in the main script, so its size can grow as Alia adds features. File size on its own doesn't show how much Alia affects your page. How much of the code runs, and how long it takes, matters more. A smaller script file won't automatically raise your PageSpeed score.

The report points to a different app or script. Is that Alia?

Alia files load from Alia domains, such as aliapopups.com or alia-prod.com, and Alia elements include alia in their name. If the flagged file or element doesn't match, it comes from your theme or another app. Contact that app's support team for help.

Will delaying Alia improve my INP?

No. Delaying Alia doesn't reduce the work it does. It moves that work from page load to right after the visitor's first interaction, which is when INP is being measured. Delaying Alia helps lab scores like your PageSpeed performance score, not INP. To improve INP, see Check a slow INP.

Will changing my trigger lower my signups?

It can. A time delay reaches visitors who don't scroll, while interaction-based triggers like scroll depth and exit intent only reach visitors who interact. To see the effect on your store, run an A/B test between your current trigger and the new one before switching fully.

How do I see my popup's effect on real shoppers, not just a test score?

A PageSpeed score is a lab measurement. To measure how your popup affects conversion rate and revenue for real visitors, run a test that compares showing your popup against showing no popup. See How to A/B test popup vs. no popup.

Is my full-screen popup also hurting my SEO?

Site speed and SEO are separate questions. For what Google says about full-screen popups and how to check whether your rankings are affected, see Does a full-screen popup hurt my SEO?

Still have questions?

Start a chat from inside the Alia app, or use the chat in our Help Center.

Did this answer your question?