Shopify storefront engineering · field note

fix: GA4 purchase 이벤트 미수집 — Shopify Webhook + Measurement Protocol 방식으로 전환

A working diagnosis of this problem and the sequence that actually resolves it, written from the operational side rather than the marketing side.

Reported context: ## 문제 GA4에서 `purchase` 이벤트가 수집되지 않음. ## 원인 분석 현재 구조는 Shopify 결제 완료 후 `return_to=/checkout-return` 파라미터로 사이트에 복귀할 때 sessionStorage를 읽어 purchase 이벤트를 발송함. GA4 page_view 데이터 확인 결과 `/checkout`은 45건이지만 `/checkout-return` page_view가 Top 10에 없어, Shopify 신규 결제 시스템이 `return_to`를 무시하고 Shopify 자체 주문완료 페이지로 리다이렉트하는 것으로 확인됨. ## 해결 방법 Shopify `orders/create` 웹훅을 Vercel API로 수신 → GA4 Measurement Protocol로 서버사이드 purchase 이벤트 발송. - 클

What is actually going on

Cart recovery leaks happen when the recovery email fires before the buyer's session expires, or when the discount code in the email has already expired by the time it is opened.

Theme performance regressions typically come from render-blocking third-party apps injected in the head, each adding 200-600ms of blocking time.

The sequence that works

  1. Reproduce the failure in a clean browser with a real destination address and a real payment method in test mode. Log the exact gateway response code.
  2. Disable all discount scripts, then re-enable one at a time to isolate the conflict.
  3. Rebuild cart recovery timing: first touch at 1 hour, second at 24 hours, third at 72 hours with a freshly minted code, each with a distinct message angle.
  4. Audit every app for where it injects assets. Move non-critical scripts to deferred loading and remove apps that duplicate native functionality.
  5. Measure again with field data, not lab data — lab scores on fast hardware hide the real mobile experience.

Where people lose time

Verify before you trust it

Run the checks above against your own data instead of adopting them at face value. The failure modes are specific enough that a single afternoon of measurement will either confirm this diagnosis or rule it out — both outcomes are useful, and guessing is not.

Automation Workflow Pack
A ready-to-use package for exactly this workflow — $27.55, delivered immediately.
Get Automation Workflow Pack · $27.55
Sold via Gumroad, which acts as merchant of record and handles payment and applicable taxes. All sales are final; see the return policy before purchase.