On most Shopify stores every click reloads the whole document, so the browser re-fetches and re-parses the header, footer and everything else just to show a different product. Shopify's new partials give themes a way to refresh part of a page instead, and we tested how far that idea goes.
On our Horizon 4.1.3 fork, a collection-to-product click left the header, footer and cart drawer in place and only the main column changed. The browse path felt close to instant. Marketing would still need to ask whether Meta, GA4 and session replay saw those later pages, because web pixels still start from a full document load.
This work depends on the Liquid July '26 developer preview, StorefrontRenderer, and the agentic editor. It is experimental, and the pixel bridge later in this article should never be a production default.
Introduction
This article explores Shopify Liquid partials, then the persistent shell we built on a Horizon fork so header, footer and cart stay loaded while only main content swaps. It keeps our own browse-speed numbers in view, and it maps the web pixel reporting gap that appears after a region swap.
The layout job of naming a page-content region, without the full experiment, lives in Shopify Liquid Partials: Swap Main Content Without Reloading Header and Footer. This post is the extended use: three named partials, prefetch, view transitions, lifecycle sync, fallbacks, benchmarks, and the pixel path.
The fork is public on GitHub. If your stack already struggles with script churn in global chrome, read common theme mistakes that kill conversion before adding interceptors. Partials change where HTML lands; they do not reduce the cost of twelve competing analytics snippets in the header.
What Shopify's partials are
Partials arrived in the Liquid July '26 developer preview, announced in Shopify's changelog on 21 July 2026. Shopify's partials documentation describes them as named regions of server-rendered HTML that JavaScript can refresh independently, without a full page reload. A theme marks a region with the {% partial %} tag, and the @shopify/partial-rendering helpers then fetch, apply or refresh it.
The documentation's own example is a collection page that names its product grid, so sorting or filtering refreshes only that grid. Its apply() helper keeps focus, text selection, form values and scroll position across the swap, and it can run inside a View Transition for an animated change. The same preview adds a {% block %} tag for composing pages in Liquid, and Shopify says the pair adds dynamic interactions without moving rendering into a client-side framework.
Two limits apply today. The feature is a developer preview, enabled with the liquid_july_26_changes feature preview on a development store, and Shopify warns that previews are subject to change. @shopify/partial-rendering is provided at runtime on enrolled storefronts and is not published to npm.
That model also lines up with the web platform's Declarative Partial Updates direction: named server HTML regions, fetched and replaced, with Liquid still the source of truth. It is progressive enhancement on top of normal Liquid, the same foundation we argue for in Online Store 2.0 and high-performance theme work.
The extension: the whole shell stays loaded
Shopify's examples refresh a grid or a cart count. We asked what happens if the partial is the whole main content area, and built that on a fork of Shopify's Horizon 4.1.3 theme, published as horizon-partials.
The layout names three partials: header, page-content and footer. When a shopper clicks a product card or a menu link, only page-content is fetched and swapped, and the header, footer, cart drawer and theme scripts stay in place. A nested header-cart partial refreshes on its own when the cart changes. We call this a persistent shell, and the repo wraps it in the details a real store needs.
layout/theme.liquid
├── snippets/partial-wpm-init-capture.liquid ← before content_for_header
├── {% partial 'header' %}
│ └── {% partial 'header-cart' %}
├── {% partial 'page-content' %} ← swapped on in-theme clicks
└── {% partial 'footer' %}
- Prefetch: header links load ahead of time, and product cards prefetch as they enter the viewport or get hover, focus or pointer-down, with a short cache of 24 entries for 30 seconds.
- View transitions: page transitions and a product image morph are theme settings merchants can switch on or off.
- Lifecycle sync: after each swap the theme updates the page title and meta tags, re-runs section scripts, highlights the current menu link, closes the mobile menu and aligns the cart count.
- Fallback: rapid clicks cancel stale requests, a failed fetch falls back to a normal page load, and checkout, external links and modified clicks load normally.
Keeping the header mounted is the point, and it creates work a full reload used to handle for free. Liquid renders aria-current="page" on first paint, so after a swap the theme walks the header links and updates aria-current from window.location. A nav link inside an open mobile drawer navigates correctly, but the drawer never unmounts, so without an explicit close buyers land on the new page with the menu still covering the screen.
Header height CSS variables are measured once at load and on resize. Re-measuring after each swap caused hero layout jumps when page transitions were on.
What merchants get, and what to ask
The visible gain is browse speed. On a local development benchmark of our own, five runs from a collection page to a product page, the median wait was 1,187 ms with a full reload and 49 ms with the partial swap, roughly 24 times faster. Stores where shoppers open several products per visit gain the most.
The first visit costs a little more, because the extra navigation code loads once. In our throttled mobile Lighthouse run, Largest Contentful Paint rose by about 1.3 seconds and Total Blocking Time by 85 ms. These are our own dev-server results, so treat them as directional and re-test on a production preview.
If a developer proposes anything like this for your store, put these questions to them:
- Which pages swap only the main content, and which still load normally?
- After a swap, do Meta, GA4, Klaviyo and session replay pixels still receive
page_viewed,collection_viewedandproduct_viewed, and how was that checked? - How does the theme editor behave, given our repo switches partials off there by design?
- Is this running on a preview store or on live traffic, given partials are a developer preview?
- Who compares pixel counts with server-side data before and after launch?
Checkout consent is a separate handoff. If marketing pixels stay denied after a payment redirect, that job lives in How to Fix Shopify Checkout Consent When Marketing Pixels Stay Denied.
The reporting gap in full
On a normal page load, Shopify's platform scripts start the Web Pixels Manager once, and every installed pixel subscribes to it. Those pixels then receive Shopify's page_viewed event, which Shopify documents as logging a customer visiting a page.
When only the main content swaps, the document never reloads, so that startup never runs again and nothing tells the pixels a new page has appeared. Shopify runs two separate event channels, and they behave differently after a swap.
| Layer | Examples | Listeners |
|---|---|---|
| Standard storefront events | shopify:page:view, shopify:collection:view | Apps, agents, standard-events inspector |
| Web pixel customer events | page_viewed, collection_viewed, product_viewed | All web pixels: custom and app (Meta, Google, Klaviyo, session replay, etc.) |
- Storefront events such as
shopify:page:viewgo to apps and debugging tools on the page. Shopify's standard events reference says this one fires once on every page load, so our theme dispatches it again after each swap. - Web pixel customer events such as
page_viewedgo to every installed pixel, and in our tests they did not fire after a swap.
We first assumed dispatching shopify:page:view after the swap would cover downstream tracking, since it is documented and exactly what themes should emit when the active page changes. It reached the inspector overlay and stopped there.
Headless browser probes confirmed the split. After a region swap, ShopifyAnalytics.meta.page.pageType updated correctly and Trekkie shim pushes fired, yet the pixel sandbox showed no page_viewed the way it does on a full load. When you debug pixels, the sandbox logs sit in the pixel iframe console, so switch DevTools away from the top-level tab.
On a partial swap, Trekkie's shim queue may still accept late page and track calls, yet that path feeds Monorail parity telemetry rather than the WPM publish() call that delivers to pixels.
Marketing would see this in Meta Events Manager and GA4, where route counts drift away from what the server delivered. The consequences below follow from pixels missing browse events, and we have not measured their effect on ad performance.
- Analytics: page and product view counts fall behind real traffic once shoppers click around inside the store.
- Attribution: a pixel that sees only the landing page has no record of later pages, so the journey to purchase looks shorter than it was.
- Ad spend: audiences and optimisation signals built from view events have less to learn from, which is a question for your media team to check against their own data.
- Conversion data: ratios such as product views to add-to-carts can mislead when one side is undercounted.
We tested page, collection and product views only, so ask your developer to confirm checkout and purchase events separately. The pixel documentation we reviewed describes no supported theme API for this today. A Shopify staff member later said they would see what they could do about web pixels on Shopify's side.
Persistent shell and the two event buses
The dashed path is the part we dislike: intercepting Web Pixels Manager before Shopify freezes the global, then manually publishing customer events after each navigation.
Is it actually faster?
We measured on 1 August 2026 against the horizon-partials repo on liquid-july.myshopify.com, using shopify theme dev locally. The baseline was commit cdf8796, Horizon 4.1.3 with full-page navigation, and the partials build was commit c058b73, the same theme with <partial-navigation>, prefetch, and view transitions. The repo's PERFORMANCE.md records the same method and run tables.
Navigation timing runs from click until #MainContent shows the new product page, on the route /collections/all to /products/gift-card, in a 1,350 × 940 viewport. Across five runs per scenario, the full reload took a median of 1,187 ms. The partial swap took a median of 49 ms, roughly 24 times faster.
| Label | Commit | Description |
|---|---|---|
| Baseline | cdf8796 | Horizon 4.1.3 with standard full-page navigation |
| Partials | c058b73 | Same theme + Liquid partials, <partial-navigation>, prefetch, view transitions |
Summary. Headline numbers from five runs per scenario (median reported):
| Metric | Baseline (full reload) | Partials (region swap) | Change |
|---|---|---|---|
| Route change: time to new content | 1,187 ms | 49 ms | ~24× faster (−96%) |
| Route change: DOM ready (baseline only) | 1,144 ms | n/a | n/a |
| First visit: Largest Contentful Paint | 7,577 ms | 8,891 ms | +1,315 ms |
| First visit: First Contentful Paint | 6,227 ms | 6,716 ms | +489 ms |
| First visit: Total Blocking Time | 29 ms | 114 ms | +85 ms |
| First visit: Cumulative Layout Shift | 0.00006 | 0.00006 | No change |
| First visit: Lighthouse performance score | 61 | 58 | −3 |
Partial updates trade a small first-load cost for faster in-store browsing. After the shell mounts, collection to product feels near-instant instead of waiting about 1.2 seconds per full reload.
#MainContent. Our own local development benchmark, five runs, median.The five baseline runs were 1,249 ms and 1,187 ms, then 1,050 ms, 1,120 ms, and 1,214 ms. The partials runs were 55 ms and 49 ms, then 46 ms, 50 ms, and 45 ms.
| Run | Baseline | Partials |
|---|---|---|
| 1 | 1,249 ms | 55 ms |
| 2 | 1,187 ms | 49 ms |
| 3 | 1,050 ms | 46 ms |
| 4 | 1,120 ms | 50 ms |
| 5 | 1,214 ms | 45 ms |
| Median | 1,187 ms | 49 ms |
That is about 1.1 seconds saved per click, with no white flash and no chrome re-render. On a full reload the browser re-fetches and re-parses the whole document, and median DOMContentLoaded on the product page was about 1,144 ms. These are cold-click numbers, so prefetch can make later clicks feel faster still.
First visit is the cost side, measured with Lighthouse 12.8.2 on /collections/all under mobile throttling with an empty cache. The performance score fell from 61 to 58.
| Core Web Vital / metric | Baseline | Partials | Notes |
|---|---|---|---|
| Performance score | 61 | 58 | Slight regression from partial-navigation modules |
| First Contentful Paint (FCP) | 6.2 s | 6.7 s | +0.5 s |
| Largest Contentful Paint (LCP) | 7.6 s | 8.9 s | +1.3 s |
| Total Blocking Time (TBT) | 29 ms | 114 ms | +85 ms main-thread blocking |
| Cumulative Layout Shift (CLS) | 0.00006 | 0.00006 | Identical: no layout instability added |
| Speed Index | 6.2 s | 6.7 s | Tracks FCP closely on this page |
Largest Contentful Paint rose from 7,577 ms to 8,891 ms, an increase of 1,315 ms. First Contentful Paint went from 6,227 ms to 6,716 ms, which is 489 ms slower, and Speed Index tracked it from 6.2 s to 6.7 s. Total Blocking Time climbed from 29 ms to 114 ms. Cumulative Layout Shift stayed at 0.00006 in both builds, so the shell does not shift when partials are on.
The extra cost comes from partial-navigation.js, lifecycle sync, view transitions, and the pixel bridge, which all run once on cold load. Those absolute seconds are dominated by local dev-server latency and theme asset volume, so treat them as directional and trust the relative comparison taken minutes apart on the same machine and store.
We left out transfer sizes, bundle analysis, Theme Editor (partials are disabled there by design), production CDN caching, and prefetch hit rate. The baseline had no <partial-navigation> element and zero partial-nav links, while the partials build had 40.
| Detection flag | Baseline | Partials |
|---|---|---|
<partial-navigation> present | No | Yes |
| Partial-nav links | 0 | 40 |
| Navigation mode | Full document | Partial region swap |
Browse-heavy stores where shoppers open several products per session gain the most. If SEO landing pages are the main entry and first-visit LCP is the constraint, defer partial modules on templates that never swap in-theme, and re-run on an HTTPS production preview with CDN caching before treating Core Web Vitals as launch criteria.
For developers: how it works
The three-partial layout and the swap
A custom element, <partial-navigation>, listens for clicks on in-scope links (data-partial-nav or anything inside a scoped header or footer container). It prevents the default navigation, pushes the URL with the History API, and fetches fresh server HTML for the page-content partial alongside any missing template stylesheets.
The navigation itself follows the documentation: partials.fetch('page-content', {url}), then partials.apply(update) inside document.startViewTransition, with an AbortController for stale requests and aria-busy on the region while it loads. Build request URLs from the current page URL or the routes object, so markets and locales keep working.
const update = await partials.fetch('page-content', { url });
if (document.startViewTransition) {
document.startViewTransition(() => partials.apply(update));
} else {
partials.apply(update);
}
partials.apply() swaps the region while keeping focus, form state, and scroll where possible. An optional View Transition animates [data-partial-page-root] inside #MainContent rather than the whole <main> element, so the header shell stays out of the snapshot. popstate runs the same flow for back and forward.
Timing matters here. The View Transition snapshot only captures DOM state during partials.apply(), so head sync, scroll reset, script re-execution, and analytics replay run in an afterTransition callback that keeps morph and slide transitions smooth.
Merchant settings live under Theme settings → Animations: page transitions default on, with styles slide, zoom, flip, swirl, iris, glitch, or random, plus a product image morph or crossfade from collection to PDP.
Prefetch, cache, and fallbacks
The theme warms that fetch before the click, and header links prefetch on connect. Product cards prefetch as they enter the viewport (IntersectionObserver, 200px margin). Debounced hover, pointerdown, and keyboard focus do the same. Results sit in a short-lived cache of 24 entries for 30 seconds, and product URLs normalise variant query params.
Rapid clicks abort stale fetches through AbortController, and duplicate navigations to the same URL share one in-flight promise. A failed fetch falls back to location.assign(url) so the buyer never sits on stale content.
Checkout URLs, external origins, modifier-key clicks, and # anchors fall through to a normal full page load. Partials and the WPM capture snippet are disabled in request.design_mode so the theme editor keeps working. partial-navigation.js loads after content_for_header so StorefrontRenderer can register the @shopify/partial-rendering import map first.
Cart mutations are separate: Shopify.actions emits shopify:cart:lines-update, and the theme refreshes only the nested header-cart partial.
Lifecycle sync after apply
After every apply, the theme syncs theme-owned head metadata marked data-partial-head-managed, re-executes section scripts, fires shopify:section:load, aligns cart badge counts, and dispatches standard page view events. syncHeaderNavActiveState() in partial-page-lifecycle.js updates aria-current from window.location. The lifecycle calls header-drawer.close() using the same animation path as the close button.
The JavaScript modules split the work:
| Module | Role |
|---|---|
assets/partial-navigation.js | Custom element; prefetch, click and popstate handling, partials.fetch + partials.apply |
assets/partial-page-lifecycle.js | Head sync, script re-exec, nav aria-current, mobile menu close, cart chrome |
assets/partial-view-transitions.js | Typed View Transition wrapper; afterTransition defers lifecycle until animation completes |
assets/partial-pixel-events.js | Trekkie replay + WPM standard-event publish after a region swap |
assets/page-view-event.js | shopify:page:view on the initial full load |
Why WPM goes quiet, and what we tried
On a full load, content_for_header injects the inline Trekkie bootstrap and loads Web Pixels Manager, which initialises once per document. That sets ShopifyAnalytics.meta, calls ShopifyAnalytics.lib.page() and lib.track(), and lets pixel iframes subscribe so they receive page_viewed on first paint. The theme also dispatches shopify:page:view from page-view-event.js.
After a partial swap, the URL and #MainContent update and WPM stays as it was. Platform scripts from content_for_header initialise once per document. Analytics then split across two buses, and neither follows a region swap on its own: the theme has to re-dispatch the storefront event, while the pixel event stays silent.
Our first attempt was Trekkie replay from fetched HTML. After each navigation we parsed the destination's inline scripts for var meta = …, ShopifyAnalytics.lib.page(…), and lib.track(…), merged the meta, and replayed the calls, which updated analytics state and Monorail events while pixel sandboxes stayed silent.
Next we tried Shopify.analytics.publish('page_viewed', …). On the storefront that function is wired to publishCustomEvent only, standard event names return false, and public docs describe no theme API for standard pixel events after partials.apply().
Re-running content_for_header was the third idea, and we dropped it. Platform head scripts assume one run per document, so a second run risks double pixel registration and fights with non-configurable globals, which is why head sync only touches theme-owned nodes.
Where the pixel counter gets thrown away
Reading the minified WPM bundle and the inline wpmLoader in content_for_header showed the detail. On init, WPM returns an API with publish for standard customer events and publishCustomEvent, and the loader keeps only the second:
var api = window.webPixelsManager.init(config);
Shopify.analytics.publish = api.publishCustomEvent; // api.publish discarded
The publish that pixels need is discarded. window.webPixelsManager is defined with configurable: false, so it cannot be replaced afterwards.
Trekkie maps page_rendered to page_viewed for Shopify.evids, but post-init lib.page() goes through a shim handler that produces Monorail payloads instead of O.publish('page_viewed', …). Themes have no documented hook for customer events after a region swap.
The bridge we built, and why we dislike it
The only reliable hook we found runs before content_for_header. snippets/partial-wpm-init-capture.liquid wraps Object.defineProperty, and when Shopify defines window.webPixelsManager it wraps init and stashes api.publish as window.__shopifyWpmPublish.
After each partial apply, assets/partial-pixel-events.js parses the destination bootstrap from fetched HTML and replays Trekkie for parity. It reads view-event-payload from collection-component or product-component, calls __shopifyWpmPublish('page_viewed', …) plus template events, and publishes horizon_partials:navigation as a custom event for debugging.
With that in place, app pixel events fire after a region swap, and localStorage.setItem('horizon-partials-pixel-debug', 'true') shows confirm logs in the main console.
We would not ship this approach on a merchant store without explicit measurement trade-offs. The bridge intercepts a platform global, parses undocumented inline script shapes, and assumes WPM payload contracts stay stable, so one CDN deploy that changes loader order, property descriptors, or the Trekkie bootstrap could silence every app pixel on an in-theme swap with no deprecation notice.
Stores where app sprawl already complicates the header have enough fragile integration points without adding another one.
The rest stays under theme control. Collection and product view events flow from collection-component and product-component built with @shopify/events, cart follows documented patterns, and the gap is specific to customer events for web pixels on route changes that are not full document loads.
Debugging pixels after a swap
Open the browser console and verify both buses separately.
shopify theme dev --standard-events-inspector
On a full reload you should see shopify:page:view. After a main-content swap you should see another shopify:page:view, plus template events when applicable.
For theme-side pixel debug in the main console:
localStorage.setItem('horizon-partials-pixel-debug', 'true');
After a collection or product swap, expect [horizon-partials/pixel] published page_viewed and template events.
Shopify's own pixel sandbox logs sit in the iframe, not in the top-level tab:
localStorage.setItem('shopify-pixel-mode', 'debug');
In DevTools, switch the console context from top to the web-pixels sandbox iframe. [shopify-pixel] logs appear there.
A custom pixel can also subscribe:
analytics.subscribe('page_viewed', (event) => console.log('page_viewed', event));
analytics.subscribe('horizon_partials:navigation', (event) => console.log('partial nav', event));
What we want from Shopify
Partials are a developer preview, and a persistent shell fits where the platform is heading, so measurement belongs in the platform too. Any one of three shapes would retire the bridge:
- Bridge standard storefront events to pixel sandboxes on a region swap:
shopify:page:viewtopage_viewed, and template view events toproduct_viewedorcollection_viewed, with correct payloads and consent checks. - Document a supported API such as
Shopify.analytics.publishStandardEvent(name, data)callable afterpartials.apply()without re-initing WPM. - Emit pixel events from StorefrontRenderer when it serves partial HTML responses.
Until one of those ships, plan measurement before you ship a persistent shell. Accept stale pixel counts on in-theme routes, fall back to a full page load where attribution matters, or publish custom events knowing app pixels only see them if they subscribe to those names.
Try the horizon-partials repo
The horizon-partials repo holds the three-partial layout, the prefetch and transition code, the lifecycle sync, the pixel bridge and a PERFORMANCE.md with our benchmark method and run tables. The README lists a live demo store (password-protected: ocontis) and the debug switch localStorage.setItem('horizon-partials-pixel-debug', 'true'). It needs a development store with the Liquid July '26 preview and the agentic editor enabled, and the README marks it as an experimental research fork.
If you build themes, try the repo on a development store and star it on GitHub so more people find it. The issue tracker is open if your results differ.
Conclusion
You can now walk Shopify Liquid partials from the documented grid refresh to a persistent shell: name the three partials, see why a main-content swap can feel much faster to browse, and decide what your reports will miss until pixels follow the swap.
On our own preview benchmarks, repeat route changes dropped from a 1,187 ms median full reload to 49 ms for a partial swap, with CLS unchanged and a modest first-load regression from the navigation runtime (LCP about +1.3 s, TBT +85 ms). The pixel gap can be separated from the layout work, and the platform is the place to close it. Our bridge shows events can fire after a region swap if you reach WPM's internal publish function, and it also shows themes should not have to.
Until Shopify emits pixel events when StorefrontRenderer serves partial HTML, plan what your reports will miss, and keep full page loads on journeys where attribution matters. Source and a live demo are in the public horizon-partials repo. For layout boundaries, partial strategy, and analytics ownership on an established store, see our Shopify theme development capability or book a stack assessment to map preview features against what your stack can maintain and measure long term.
Experimental public fork of Horizon 4.1.3, which requires the Liquid July '26 feature preview.
Octavian Contis leads Shopify stack work at oContis Studio.



