<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hitesh Singh</title>
    <description>The latest articles on DEV Community by Hitesh Singh (@webconsultingie).</description>
    <link>https://dev.to/webconsultingie</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4172306%2F10433c75-f173-4846-95c7-2a88b552c627.png</url>
      <title>DEV Community: Hitesh Singh</title>
      <link>https://dev.to/webconsultingie</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/webconsultingie"/>
    <language>en</language>
    <item>
      <title>GA4 cross-domain tracking when your ads land on one domain and convert on another</title>
      <dc:creator>Hitesh Singh</dc:creator>
      <pubDate>Wed, 04 Nov 2026 04:40:58 +0000</pubDate>
      <link>https://dev.to/webconsultingie/ga4-cross-domain-tracking-when-your-ads-land-on-one-domain-and-convert-on-another-29bb</link>
      <guid>https://dev.to/webconsultingie/ga4-cross-domain-tracking-when-your-ads-land-on-one-domain-and-convert-on-another-29bb</guid>
      <description>&lt;p&gt;A lot of ecommerce setups don't live on one clean domain. Ads point at a campaign or intermediary domain, a redirect sends the visitor to the main store, and checkout happens somewhere else again. Every hop is a chance for Google Analytics 4 to lose the visitor and start a brand new session.&lt;/p&gt;

&lt;p&gt;The symptoms are familiar: your own domain shows up as a top referrer, paid traffic looks like it never converts, and "Direct" or "(not set)" quietly swallows revenue. Google Ads and Meta still report conversions, but GA4 can't tell you which campaign drove them.&lt;/p&gt;

&lt;p&gt;This post walks through how we set up and verify cross-domain tracking for that kind of flow. It's aimed at developers and marketers who can edit tags and redirects, and who want a checklist they can run end to end rather than a list of settings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why GA4 loses the visitor
&lt;/h2&gt;

&lt;p&gt;GA4 identifies a browser with a first-party cookie (&lt;code&gt;_ga&lt;/code&gt;) set on the domain the visitor is on. Cookies don't travel between &lt;code&gt;brand-campaign.com&lt;/code&gt; and &lt;code&gt;brand.com&lt;/code&gt;, so when the visitor crosses over, the second domain sees a stranger. It creates a new client ID and a new session, and the referrer is the first domain.&lt;/p&gt;

&lt;p&gt;Cross-domain measurement fixes this by passing the client and session identifiers along in a URL parameter called &lt;code&gt;_gl&lt;/code&gt; when the visitor clicks a link to another configured domain. The receiving page reads &lt;code&gt;_gl&lt;/code&gt;, adopts the same IDs, and the session carries on.&lt;/p&gt;

&lt;p&gt;That only works if three things are true:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Both domains run the same GA4 property (the same measurement ID).&lt;/li&gt;
&lt;li&gt;Both domains are listed in the property's cross-domain configuration.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;_gl&lt;/code&gt; parameter survives the trip, including through any redirects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most broken setups fail on the third point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: One property, one tag, every domain
&lt;/h2&gt;

&lt;p&gt;Check that every domain in the journey sends data to the same GA4 web data stream. If the intermediary domain has its own property, the visitor's history starts over the moment they leave it, no matter what else you configure.&lt;/p&gt;

&lt;p&gt;Use the same Google tag (or the same Google Tag Manager container) on every domain. Two different tags with the same measurement ID can work, but it makes debugging much harder later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Configure your domains in GA4
&lt;/h2&gt;

&lt;p&gt;In GA4, go to Admin, then Data streams, pick your web stream, open "Configure tag settings", then "Configure your domains". Add each domain in the journey, for example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;brand-campaign.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;brand.com&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;any separate checkout or booking domain you control&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use "Contains" or "Exactly matches" rules that cover the subdomains you actually use. Once this is saved, the Google tag starts decorating outbound links to those domains with &lt;code&gt;_gl&lt;/code&gt; automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Add unwanted referrals
&lt;/h2&gt;

&lt;p&gt;In the same tag settings, open "List unwanted referrals" and add your own domains and any payment provider that bounces visitors back to the site (PayPal, Klarna, 3-D Secure pages). Without this, a return from the payment page can start a new session credited to the payment provider instead of your campaign.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Make sure redirects keep the query string
&lt;/h2&gt;

&lt;p&gt;This is where intermediary-domain setups usually break. Automatic link decoration only adds &lt;code&gt;_gl&lt;/code&gt; to links the visitor clicks. If your intermediary page uses a server-side redirect, a meta refresh or a JavaScript &lt;code&gt;location&lt;/code&gt; change, the tag never decorates anything, and even a decorated URL can lose its parameters on the way.&lt;/p&gt;

&lt;p&gt;Two rules cover most cases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preserve the full query string on every redirect.&lt;/strong&gt; A 301 or 302 from the intermediary domain must pass &lt;code&gt;gclid&lt;/code&gt;, &lt;code&gt;fbclid&lt;/code&gt;, &lt;code&gt;utm_*&lt;/code&gt; and &lt;code&gt;_gl&lt;/code&gt; through untouched. In nginx that looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;301&lt;/span&gt; &lt;span class="s"&gt;https://brand.com&lt;/span&gt;&lt;span class="nv"&gt;$request_uri&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;$request_uri&lt;/code&gt; includes the query string. A rule like &lt;code&gt;return 301 https://brand.com/;&lt;/code&gt; silently drops it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't rely on script redirects to carry &lt;code&gt;_gl&lt;/code&gt;.&lt;/strong&gt; The Google tag decorates links when a visitor clicks them. A &lt;code&gt;window.location&lt;/code&gt; change or meta refresh on page load happens before or outside that, so no &lt;code&gt;_gl&lt;/code&gt; is added and the session breaks. If the intermediary page has to send people on, give it a real link or button to the main domain that the visitor clicks, and let the tag decorate it. If you're using Google Tag Manager, you can also decorate forms with the linker settings in the Google tag configuration.&lt;/p&gt;

&lt;p&gt;The cleanest option of all is to avoid the extra hop when you can. If the intermediary exists for ad policy reasons, keep a real landing page there with a clear call to action, rather than an instant redirect. You get decoration for free and a page that reviewers can actually see.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Keep ad click IDs alive
&lt;/h2&gt;

&lt;p&gt;Cross-domain linking keeps the GA4 session together, but Google Ads and Meta also rely on their own click IDs. Make sure &lt;code&gt;gclid&lt;/code&gt; reaches the domain where your conversion tag fires, and enable the Conversion Linker in Google Tag Manager on every domain. For Meta, pass &lt;code&gt;fbclid&lt;/code&gt; through so the &lt;code&gt;_fbc&lt;/code&gt; cookie can be set on the converting domain, and send purchases through the Conversions API where you can.&lt;/p&gt;

&lt;p&gt;If the store is on Shopify, its native Google and Meta channels handle the checkout side. Your job is to get the visitor and their parameters onto the store domain intact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Verify end to end
&lt;/h2&gt;

&lt;p&gt;Don't trust the settings screen. Walk the journey yourself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open an ad-style URL on the first domain with test parameters, for example &lt;code&gt;?utm_source=test&amp;amp;utm_medium=cpc&amp;amp;gclid=TEST123&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Follow the path to the main domain and check the address bar. You should see &lt;code&gt;_gl=&lt;/code&gt; alongside your original parameters.&lt;/li&gt;
&lt;li&gt;In GA4 DebugView (with Tag Assistant connected), confirm the &lt;code&gt;page_view&lt;/code&gt; on the second domain has the same session, not a new &lt;code&gt;session_start&lt;/code&gt; with a referral.&lt;/li&gt;
&lt;li&gt;Complete a test purchase or lead form and check the conversion is attributed to your test source.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A day or two later, check the reports. In Traffic acquisition, your own domains should disappear as referrers, and the share of "Direct" conversions should drop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Different measurement IDs on each domain.&lt;/strong&gt; Linking can't merge two properties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redirects that drop parameters.&lt;/strong&gt; The most common cause by far.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Caching layers stripping &lt;code&gt;_gl&lt;/code&gt;.&lt;/strong&gt; Some CDN or page-cache rules ignore or remove unknown query parameters. Allow &lt;code&gt;_gl&lt;/code&gt; through.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consent banners blocking the linker.&lt;/strong&gt; If analytics consent is denied on the first domain, there's nothing to pass on. Make sure consent choices carry across domains too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgetting payment returns.&lt;/strong&gt; Add payment providers to unwanted referrals.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Cross-domain tracking is one setting in GA4, but making it work is a journey problem, not a settings problem. Use one property, list every domain, keep the query string through every hop, and test the full path with real parameters. Once the session survives the handoff, your campaign data finally lines up with what the ad platforms report.&lt;/p&gt;

&lt;p&gt;We work through setups like this with ecommerce brands at &lt;a href="https://webconsulting.ie" rel="noopener noreferrer"&gt;Web Consulting Agency&lt;/a&gt;. If your paid traffic looks like it never converts in GA4, the handoff between domains is the first place to look.&lt;/p&gt;

</description>
      <category>analytics</category>
      <category>seo</category>
      <category>webdev</category>
      <category>marketing</category>
    </item>
    <item>
      <title>Fixing INP on Shopify stores: a practical guide for theme developers</title>
      <dc:creator>Hitesh Singh</dc:creator>
      <pubDate>Thu, 15 Oct 2026 06:09:24 +0000</pubDate>
      <link>https://dev.to/webconsultingie/fixing-inp-on-shopify-stores-a-practical-guide-for-theme-developers-212a</link>
      <guid>https://dev.to/webconsultingie/fixing-inp-on-shopify-stores-a-practical-guide-for-theme-developers-212a</guid>
      <description>&lt;p&gt;Most Shopify performance work still focuses on load speed: compress the hero image, lazy-load below the fold, trim the app list. That matters, but it misses the metric that most often fails on real stores today: &lt;strong&gt;Interaction to Next Paint (INP)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;INP measures how quickly the page responds visually after a user does something: taps a variant swatch, opens the cart drawer, types in predictive search, clicks "Add to cart". It replaced First Input Delay as a Core Web Vital in March 2024, and it is much harder to pass, because it looks at (nearly) every interaction across the whole visit rather than only the first one.&lt;/p&gt;

&lt;p&gt;This post walks through how we find and fix INP problems on Shopify themes. It is aimed at developers who are comfortable in Liquid and JavaScript and want a repeatable process rather than a list of generic tips.&lt;/p&gt;

&lt;h2&gt;
  
  
  What INP actually measures
&lt;/h2&gt;

&lt;p&gt;An interaction has three phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Input delay&lt;/strong&gt;: the time between the tap and your event handler starting. This is usually caused by something else hogging the main thread (a third-party script, a hydration task, a long-running timer).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing time&lt;/strong&gt;: how long your event handlers take to run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Presentation delay&lt;/strong&gt;: the time for the browser to recalculate styles, lay out and paint the next frame after your handlers finish.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The page's INP is roughly its slowest interaction (outliers are trimmed on pages with many interactions). Google's thresholds, measured at the 75th percentile of real users, are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Good:&lt;/strong&gt; 200 ms or less&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs improvement:&lt;/strong&gt; 200 to 500 ms&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Poor:&lt;/strong&gt; over 500 ms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important part is "real users". INP is a field metric. Lighthouse in a lab run cannot report it because nobody is clicking anything, so you need field data to know where you stand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Find out which pages and interactions are slow
&lt;/h2&gt;

&lt;p&gt;Start with the data you already have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Shopify admin:&lt;/strong&gt; the Web performance report in the admin shows INP alongside LCP and CLS for your storefront, with a timeline you can line up against app installs and theme changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PageSpeed Insights / CrUX:&lt;/strong&gt; if the store has enough traffic, the "Discover what your real users are experiencing" section gives you INP at the URL and origin level.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search Console:&lt;/strong&gt; the Core Web Vitals report groups failing URLs by template, which on Shopify usually maps neatly to product, collection, cart and home.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those tell you &lt;em&gt;where&lt;/em&gt;. To learn &lt;em&gt;which interaction&lt;/em&gt; and &lt;em&gt;why&lt;/em&gt;, add the attribution build of Google's &lt;code&gt;web-vitals&lt;/code&gt; library. A small snippet in &lt;code&gt;theme.liquid&lt;/code&gt; is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;onINP&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://unpkg.com/web-vitals@4/dist/web-vitals.attribution.js?module&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;onINP&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;rating&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;attribution&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rating&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;good&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;interactionTarget&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;interactionType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;inputDelay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;inputDelay&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;processing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;processingDuration&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;presentation&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attribution&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;presentationDelay&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;page&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendBeacon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://your-endpoint.example.com/inp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send it wherever suits you: a GA4 custom event, a small serverless endpoint, or your existing analytics. After a few days you will have a list like "&lt;code&gt;variant-picker input&lt;/code&gt; on product pages, mostly processing time" or "&lt;code&gt;cart-drawer button&lt;/code&gt;, mostly input delay". That breakdown tells you which fix to reach for.&lt;/p&gt;

&lt;p&gt;For local debugging, Chrome DevTools' Performance panel shows live INP as you click around, and recording an interaction shows you exactly which tasks ran. Turn on CPU throttling (4x or 6x) so a fast laptop behaves more like a mid-range phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Fix the usual Shopify culprits
&lt;/h2&gt;

&lt;p&gt;In our experience, slow INP on Shopify almost always comes from a handful of patterns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Variant pickers that do too much at once
&lt;/h3&gt;

&lt;p&gt;A typical variant change handler updates the price, swaps the gallery image, rewrites the URL, re-renders the buy buttons, recalculates stock messaging and fires analytics events, all synchronously. Each piece is small; together they block the next paint.&lt;/p&gt;

&lt;p&gt;The fix is to paint the visible change first and defer the rest:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;yieldToMain&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;scheduler&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;yield&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;scheduler&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;yield&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;onVariantChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// 1. The thing the user is looking at&lt;/span&gt;
  &lt;span class="nf"&gt;updateSelectedSwatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;updatePrice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// 2. Let the browser paint&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;yieldToMain&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="c1"&gt;// 3. Everything else&lt;/span&gt;
  &lt;span class="nf"&gt;updateGallery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replaceState&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`?variant=&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nf"&gt;sendAnalytics&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;variant_change&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;scheduler.yield()&lt;/code&gt; is available in Chromium-based browsers; the &lt;code&gt;setTimeout&lt;/code&gt; fallback keeps it working elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  Re-rendering whole sections on every change
&lt;/h3&gt;

&lt;p&gt;Dawn-style themes often call the Section Rendering API on variant change and replace a large chunk of the DOM with the response. Replacing big subtrees forces expensive style and layout work, which shows up as presentation delay. Where you can, swap only the nodes that changed (price, availability, buy button) instead of the whole section, and abort stale requests with an &lt;code&gt;AbortController&lt;/code&gt; when the user clicks through variants quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Third-party apps on the main thread
&lt;/h3&gt;

&lt;p&gt;Reviews widgets, upsell popups, chat bubbles, heatmaps and tracking pixels all compete for the main thread. When a long task from one of them is running, your tap waits. This is the main source of &lt;em&gt;input delay&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Practical steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Audit app embeds in the theme editor and remove anything that isn't earning its keep. Uninstalling an app doesn't always remove its leftover snippets, so check &lt;code&gt;theme.liquid&lt;/code&gt; and &lt;code&gt;snippets/&lt;/code&gt; too.&lt;/li&gt;
&lt;li&gt;Load non-critical widgets on interaction or when they scroll into view, rather than on page load.&lt;/li&gt;
&lt;li&gt;Move tracking pixels into Shopify's Customer Events (web pixels), which load in a sandboxed environment instead of as scripts injected straight into the theme.&lt;/li&gt;
&lt;li&gt;Use the Long Animation Frames API (&lt;code&gt;PerformanceObserver&lt;/code&gt; with type &lt;code&gt;long-animation-frame&lt;/code&gt;) to see which script URLs are behind long frames. It names the scripts responsible, which makes app conversations much more concrete.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cart drawers and predictive search
&lt;/h3&gt;

&lt;p&gt;The cart drawer often fetches &lt;code&gt;/cart.js&lt;/code&gt;, re-renders, runs a free-shipping bar calculation and opens an animation, all in one handler. Open the drawer immediately with a loading state, then fill it in. For predictive search, debounce input (around 150 to 300 ms) and cancel in-flight requests so typing never queues up work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Large DOMs and expensive CSS
&lt;/h3&gt;

&lt;p&gt;Collection pages with hundreds of product cards, mega menus rendered in full on every page, and heavy CSS selectors all make each frame costlier. Paginate or progressively render long grids, render mega menu content only when it's opened, and consider &lt;code&gt;content-visibility: auto&lt;/code&gt; for off-screen sections so the browser can skip their rendering work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Verify and keep it fixed
&lt;/h2&gt;

&lt;p&gt;After shipping a fix, confirm it the same way you found the problem: re-run the interaction in DevTools with throttling, then watch your field data. CrUX and Search Console use a rolling 28-day window, so give it a few weeks before calling it done; your own &lt;code&gt;web-vitals&lt;/code&gt; beacon will show movement much sooner.&lt;/p&gt;

&lt;p&gt;To stop regressions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep the attribution snippet running permanently and alert when the 75th percentile crosses 200 ms on a key template.&lt;/li&gt;
&lt;li&gt;Add a quick INP check to your process whenever a new app is installed or the theme is updated.&lt;/li&gt;
&lt;li&gt;Keep a short "performance budget" note in the theme repo: maximum app embeds, no synchronous third-party scripts in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;, and so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why this is worth the effort
&lt;/h2&gt;

&lt;p&gt;INP failures are felt directly as a store that seems "laggy" on mobile, and those moments happen on the pages closest to purchase: product, cart and checkout entry points. Fixing them also feeds into Core Web Vitals reporting in Search Console, which is part of the wider page experience picture for SEO.&lt;/p&gt;

&lt;p&gt;If you'd like a second pair of eyes on a store's Core Web Vitals, or a broader technical SEO and CRO review, our team at &lt;a href="https://webconsulting.ie" rel="noopener noreferrer"&gt;Web Consulting Agency&lt;/a&gt; does this kind of work for Shopify and custom ecommerce builds.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Written by the team at &lt;a href="https://webconsulting.ie" rel="noopener noreferrer"&gt;Web Consulting Agency&lt;/a&gt;, a Dublin-based web, SEO and growth consultancy working with ecommerce brands and app companies.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webperf</category>
      <category>shopify</category>
      <category>javascript</category>
      <category>performance</category>
    </item>
    <item>
      <title>How ecommerce brands can show up in AI answers (GEO) in 2026: a practical checklist</title>
      <dc:creator>Hitesh Singh</dc:creator>
      <pubDate>Fri, 09 Oct 2026 01:53:37 +0000</pubDate>
      <link>https://dev.to/webconsultingie/how-ecommerce-brands-can-show-up-in-ai-answers-geo-in-2026-a-practical-checklist-3k1e</link>
      <guid>https://dev.to/webconsultingie/how-ecommerce-brands-can-show-up-in-ai-answers-geo-in-2026-a-practical-checklist-3k1e</guid>
      <description>&lt;p&gt;More shoppers now start product research by asking an AI assistant instead of typing keywords into Google. They ask things like "what is a good gradual self-tan for pale skin" or "best CBD balm for runners" and get a short answer with a few brands named. If your brand is not in that answer, you are not in the consideration set.&lt;/p&gt;

&lt;p&gt;Generative Engine Optimization (GEO), sometimes called Answer Engine Optimization (AEO), is the work of making your brand easy for these systems to find, understand and trust. It builds on SEO rather than replacing it. Here is the checklist we use with ecommerce brands.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Find out where you stand today
&lt;/h2&gt;

&lt;p&gt;Before changing anything, measure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write 20 to 30 prompts a real customer would ask. Mix category questions ("best vegan self-tan"), problem questions ("how to stop gym clothes smelling") and comparison questions ("Brand A vs Brand B").&lt;/li&gt;
&lt;li&gt;Run them in ChatGPT, Perplexity, Gemini, Copilot and Google (to see AI Overviews).&lt;/li&gt;
&lt;li&gt;For each prompt, record: is your brand mentioned, is your site cited as a source, which competitors appear, and which third-party pages are cited.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last column is the most useful. It tells you which review sites, publications, forums and marketplaces the AI tools lean on in your category.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Make sure AI crawlers can actually read your site
&lt;/h2&gt;

&lt;p&gt;You cannot be cited if your pages cannot be fetched.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check robots.txt. Make sure you are not blocking search-related crawlers such as Googlebot, Bingbot, OAI-SearchBot (ChatGPT search) and PerplexityBot. Decide separately whether to allow training crawlers like GPTBot and Google-Extended; that is a business choice, not a ranking requirement.&lt;/li&gt;
&lt;li&gt;Check your CDN or firewall. Bot protection rules sometimes block these crawlers by accident.&lt;/li&gt;
&lt;li&gt;Make sure key content is in the HTML. If product descriptions, prices or reviews only load through JavaScript, some crawlers will miss them. View the page source and confirm the important text is there.&lt;/li&gt;
&lt;li&gt;Keep pages fast and stable. Slow, error-prone pages get crawled less.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Turn product pages into clear answers
&lt;/h2&gt;

&lt;p&gt;AI tools pull facts. Give them clean, specific facts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;State plainly what the product is, who it is for and what problem it solves, in the first few lines.&lt;/li&gt;
&lt;li&gt;List the details people ask about: ingredients or materials, sizes, usage, shade or fit guidance, shipping times, returns policy.&lt;/li&gt;
&lt;li&gt;Add a short FAQ on each key product page using real questions from your customer service inbox and reviews.&lt;/li&gt;
&lt;li&gt;Avoid vague copy like "the ultimate glow experience". A sentence like "a gradual self-tan lotion for fair to medium skin that develops in 4 to 6 hours" is far easier to quote.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Add structured data
&lt;/h2&gt;

&lt;p&gt;Schema markup helps machines understand your pages without guessing.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product and Offer schema on product pages (name, brand, price, currency, availability, GTIN or SKU).&lt;/li&gt;
&lt;li&gt;AggregateRating and Review schema, only for genuine reviews shown on the page.&lt;/li&gt;
&lt;li&gt;Organization schema on the homepage, with your logo, contact details and sameAs links to your official social profiles.&lt;/li&gt;
&lt;li&gt;FAQPage schema where you have real FAQ content.&lt;/li&gt;
&lt;li&gt;Validate with Google's Rich Results Test and the Schema Markup Validator.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Publish content that answers buying questions
&lt;/h2&gt;

&lt;p&gt;Look at the prompts from step 1 and create pages that answer them directly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Buying guides: "How to choose a gradual tan for sensitive skin."&lt;/li&gt;
&lt;li&gt;Comparisons: your product vs a common alternative, written fairly.&lt;/li&gt;
&lt;li&gt;Problem pages: "Why gym clothes still smell after washing, and what helps."&lt;/li&gt;
&lt;li&gt;Start each page with a two or three sentence direct answer, then go deeper. Use clear headings that match how people phrase the question.&lt;/li&gt;
&lt;li&gt;Add an author or reviewer with real expertise where it matters, especially in skincare, supplements and wellness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Build your presence beyond your own site
&lt;/h2&gt;

&lt;p&gt;AI answers often cite third-party sources more than brand sites.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the "cited sources" list from step 1. If a category roundup on a publication keeps getting cited, that is where you want a mention.&lt;/li&gt;
&lt;li&gt;Keep your brand name, description and contact details consistent across your site, marketplaces, social profiles and directories.&lt;/li&gt;
&lt;li&gt;Encourage reviews on the platforms that show up in answers for your category.&lt;/li&gt;
&lt;li&gt;Take part honestly in communities like Reddit where your customers already ask questions. Helpful answers age well; promotional posts do not.&lt;/li&gt;
&lt;li&gt;Pursue digital PR: expert comments, original data from your own customers, and founder stories.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Keep product feeds clean
&lt;/h2&gt;

&lt;p&gt;Shopping answers in Google and in AI assistants rely heavily on product data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep your Google Merchant Center feed accurate: titles, prices, availability, images, GTINs and shipping.&lt;/li&gt;
&lt;li&gt;Make sure feed data matches the live page exactly. Mismatched prices or stock hurt trust.&lt;/li&gt;
&lt;li&gt;Watch merchant programmes from AI assistants as they open up in your markets, and make sure your feed is ready.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  8. Handle regulated categories with care
&lt;/h2&gt;

&lt;p&gt;If you sell CBD, supplements or skincare with active ingredients, be precise.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid medical claims you cannot support. AI tools and ad platforms are both cautious here.&lt;/li&gt;
&lt;li&gt;Publish lab reports, certificates of analysis and ingredient sourcing where relevant. Verifiable documents are good citation material.&lt;/li&gt;
&lt;li&gt;Explain what your product does and does not do in plain language.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  9. Measure and repeat monthly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Re-run your prompt list every month and track mentions and citations over time.&lt;/li&gt;
&lt;li&gt;In GA4, watch referral traffic from chatgpt.com, perplexity.ai, gemini.google.com and copilot.microsoft.com. ChatGPT often adds utm_source=chatgpt.com to links.&lt;/li&gt;
&lt;li&gt;Note which pages get cited and build more pages like them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A simple starting order
&lt;/h2&gt;

&lt;p&gt;If you only have a few hours this month:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run the prompt audit (step 1).&lt;/li&gt;
&lt;li&gt;Fix crawler access and HTML rendering (step 2).&lt;/li&gt;
&lt;li&gt;Rewrite your top five product pages with clear facts and FAQs (step 3).&lt;/li&gt;
&lt;li&gt;Add Product and Organization schema (step 4).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That alone puts many brands ahead of their competitors, because most ecommerce sites have not done the basics yet.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Hitesh Singh, Sales &amp;amp; Marketing Director at &lt;a href="https://www.webconsulting.ie" rel="noopener noreferrer"&gt;Web Consulting Agency&lt;/a&gt;, a Dublin team that helps ecommerce and wellness brands with website design, SEO, GEO and paid media. If you'd like a second pair of eyes on how your brand shows up in AI answers, we offer a free 30-minute consultation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>seo</category>
      <category>ecommerce</category>
      <category>ai</category>
      <category>marketing</category>
    </item>
  </channel>
</rss>
