Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Price or stock widget shifting the Add to cart button: fix

PRF-034High impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

Many product pages load the main content first and add extras later: a live price, a stock message such as "Only 3 left", a delivery estimate, a buy-now-pay-later badge or a subscription selector. These are often injected by an app or script after the page is drawn.

If the page did not leave room for them, everything below moves down when they appear. This is called layout shift, and Google measures it as Cumulative Layout Shift (CLS). When the moving item is the Add to cart button, the problem hits revenue directly.

The button moves as the widget arrives

The page loads, the shopper aims at the button, then the widget pushes it down.

Why it costs you leads or sales

Shoppers on mobile often tap the moment the button appears. If it jumps 40 to 80 pixels, the tap lands on a different element: an image, a variant option, a link or empty space. The shopper sees nothing happen, or the wrong thing happen, and many will not try again.

Where the sale is lost
  1. Product page loadsButton drawn in its first position
  2. Widget injected lateNo space reserved, content pushed down
  3. Tap on Add to cartLands on the wrong element
  4. Cart and checkoutNever reached

The break is at the widget, and everything after it depends on a clean tap.

Add to cart taps that workExample numbers
Add to cart taps that work (example)Stable layout: 100 %; Widget shifts button: 85 %0387710085Stable layoutWidget shifts button%

Example: illustrative numbers showing how a late shift can reduce successful taps on a product page.

How to check if your site has it

Find the shifting widget
  1. Record the page load

    Open a product page in Chrome, press F12, open the Performance tab, tick Screenshots and click Reload and record.

  2. Look for Layout Shift entries

    In the Experience row, red Layout Shift markers show when the page moved. Click one to see which element moved and by how much.

  3. Throttle the network

    Set the Network to Fast 4G or Slow 4G and CPU to 4x slowdown. Late widgets are easier to see on slow connections.

  4. Turn on layout shift regions

    Open the Rendering panel (three-dot menu, More tools, Rendering) and tick Layout Shift Regions. Shifted areas flash blue as you reload.

  5. Test on a real phone

    Load the page and tap Add to cart as soon as it appears. Repeat a few times, since the shift depends on timing.

You can also check PageSpeed Insights for the page. The diagnostics list the elements that contributed most to CLS, which often names the widget container.

How to fix it

The rule is the same everywhere: decide how tall the widget will be, reserve that space before it loads, and show a neutral placeholder until the real content arrives.

Reserve space for the widgetcss
.stock-widget,
.price-widget {
  min-height: 48px; /* set to the widget's final height */
  display: block;
}

/* Optional: a quiet placeholder while loading */
.stock-widget:empty {
  background: #f2f2f2;
  border-radius: 4px;
}
Apply the fix on your platform
  1. Find the container

    In Online Store, Themes, Edit code, open the product section or snippet and find the element where the app block renders. Inspect the live page to get its class name.

  2. Add the reserved height

    Add the CSS above to your theme stylesheet (for example base.css or theme.css), using the app's container class. Measure the loaded widget in dev tools and use that height.

  3. Move app blocks above the button

    If the app is an app block, place it in the theme editor where its space is fixed, or render the price with Liquid instead of a script so it is in the first HTML.

Placeholder in the page HTMLhtml
<div id="stock-widget" class="stock-widget" style="min-height:48px"></div>
<button type="submit" name="add">Add to cart</button>
Product page layout

Before

  • Widget injected above the button after load
  • Button moves down as the widget appears
  • Taps land on the wrong element

After

  • Widget space reserved with min-height
  • Button stays in the same place from first paint
  • Taps hit Add to cart
Try it: reserved space on or offInteractive
No space reserved for the widget

No reserved space

Leads or data lost

The widget loads late, the button jumps down, and the tap lands on the wrong element.

Toggle to see how reserved space changes what the shopper experiences.

How to confirm it's fixed

Fix verification
  • Reload the product page with the Performance panel recording and see no Layout Shift marker on the button or widget.
  • Layout Shift Regions no longer flash blue around the widget.
  • On a throttled connection, the button stays put while the widget loads.
  • Tapping Add to cart straight after load works on a real phone, several times in a row.
  • PageSpeed Insights no longer lists the widget container among CLS contributors.
  • Test products with and without the stock message, and with long and short prices.

How to prevent it happening again

Habits that stop it coming back
  • Ask before installing any app that adds content to the product page whether it reserves space.
  • Test the product page on a throttled connection after every theme, app or tag change.
  • Keep reserved heights in one place in your stylesheet, with a comment naming the widget.
  • Review widget heights when an app updates its design.
  • Render price and stock on the server whenever you can.

How FunnelGuard handles this

FunnelGuard detects this only partly. It checks for layout shift (CLS) on the product step when its robot visitor runs your journey, so a widget that pushes content around can show up as a shift on that page.

What it does not do: it does not tell you that a real person mis-clicked, and it cannot say how many shoppers tapped the wrong element. The mis-click risk is not measured, only the shift that creates it.

To cover the rest by hand, test the product page on a real phone with a throttled connection after each change, and tap Add to cart as soon as it appears. FunnelGuard can then run the add-to-cart step on a schedule from the EU or the US, and alerts you once a failure is confirmed from a second region. The Free plan covers 1 site and 2 journeys with daily checks and no card, and a free read-only website audit is available.

Questions people ask

Why does my Add to cart button move when the page loads?

Something above the button, such as a price, stock message or badge, loads after the page is first drawn and pushes the button down. The page did not reserve space for it. Setting a min-height on the widget's container stops the movement.

How do I stop a stock widget from causing layout shift?

Reserve the widget's final height with CSS (min-height or aspect-ratio) before it loads, and show a neutral placeholder until the data arrives. Replace content inside that box rather than inserting new elements above the button.

Does layout shift on a product page affect my Google ranking?

Layout shift is measured as CLS, which is part of Core Web Vitals and Google's page experience signals. A high CLS on product pages can work against you, though it is one factor among many. The bigger cost is usually missed taps on the button.

How do I find which element is causing layout shift?

In Chrome dev tools, record a page load in the Performance tab and look for red Layout Shift markers in the Experience row. Clicking one shows the element that moved. PageSpeed Insights also lists the elements that contributed most to CLS.

Why do shoppers tap the wrong thing on mobile product pages?

Often the layout moved a split second before the tap. A late widget pushed the button down, so the tap landed on whatever took its place. Reserving space for late content removes the cause.

Can I fix a third-party widget that I can't edit?

Usually yes. You can wrap its mount point in your own element and give that element a fixed min-height in your theme CSS. You do not need to change the app's code.

Does FunnelGuard detect a price widget shifting the Add to cart button?

Only partly. FunnelGuard checks for layout shift on the funnel step, but it does not measure whether a real shopper mis-clicked. Test on a real phone to cover that part.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: CLS only; mis-click risk.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.