Urgent.News

What's breaking now, across thousands of outlets.

Tech

Shopify to GA4 without GTM: native events plus a server-side Measurement Protocol fallback

If you run a Shopify store, the GA4 setup question usually gets answered with "install Google Tag Manager." You don't need it. Shopify's Google & YouTube sales channel emits the whole GA4 ecommerce event set natively, and it takes about five minutes. The part nobody covers is what happens after: your GA4 purchase count drifts below your Shopify order count and stays there. That gap is…

If you operate an e-commerce store on Shopify, Google Analytics 4 (GA4) setup is often simplified by avoiding Google Tag Manager (GTM). Shopify's Google & YouTube sales channel natively emits all necessary GA4 ecommerce events, a process that takes just a few minutes. However, an issue arises where GA4 purchase counts may fall short of Shopify order counts due to client-side event loss caused by browser restrictions like Intelligent Browsing Technologies (ITP), ad blockers, and iOS limitations.

The solution is a server-side Measurement Protocol fallback using a webhook to send purchase events directly to GA4.

Key points:

- Shopify's Google & YouTube channel emits GA4 ecommerce events natively with no extra configuration.

- The complete funnel includes events such as page_view, view_item, add_to_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info, and purchase.

- GA4 tracks revenue but does not handle profit per order, ad-click attribution, or cross-order customer lifetime value (LTV), requiring separate systems like GA4 User ID or CRM.

- To create a GA4 property, go to analytics.google.com, set the reporting timezone and currency, select eCommerce as the business category, and generate a Measurement ID.

- Connect Shopify by navigating to Shopify Admin → Sales channels → Google & YouTube, install the channel if necessary, connect the Google account owning the GA4 property, and select the property in the Measurement section.

- Verify the integration by using the Realtime report in GA4 to ensure the page_view event appears with the correct URL, and place a test order to check for purchase events within 30-60 seconds.

- Implement immediate config changes, such as setting data retention to 14 months and enabling Google Signals for cross-device reporting.

- For the server-side layer, use a webhook runner like Make.com or n8n to send purchase events to GA4 via Measurement Protocol, ensuring to include client_id and proper JSON formatting to avoid event rejection.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Understanding Subqueries and CTE's

Introduction Imagine you are a data analyst working for a retail company. Your manager asks you to identify customers who spend more than the average customer, employees earning above their…

  • Subqueries are SQL statements placed inside other queries for complex calculations.
  • CTEs are temporary named result sets defined within SQL statements to simplify queries.
  • Subqueries come in three types: scalar, multiple-row, and correlated.

Sticky Routing That Never Expires Isn't Sticky It's Permanent

Session affinity is a simple idea: route a client to the same backend node it used last time, so state that lives on that node (a cache, a connection, an in-memory session) doesn't have to move.

  • Session affinity permanently assigns clients to backend servers, causing imbalance.
  • Lack of cleanup mechanism for expired assignments leads to overload on certain nodes.
  • Adding TTL to assignments resolves silent failure by expiring idle client assignments.

More from Saturday 26 September →