Shopify GA4 tracking with a custom pixel: analytics.subscribe checkout_completed sending a GA4 purchase event

Additional scripts no longer run on Shopify. How to rebuild GA4 ecommerce tracking with a custom pixel: full code for page views, add to cart, checkout and purchase, plus consent and testing.