**Requirements:**
  • Stripe Payment Link
  • Google Analytics 4 Property
  • Server GTM Container
Stripe Payment Links are probably one of the easiest ways to sell products or services online. You can drop the link on any static landing page to direct customers to simple checkout screen.

It is not so easy to track and analyse the traffic going through such checkout. Obviously, Stripe gives some options, but they are not ideal:

What if there is a simpler way that:

Let's see how simple it is to send purchase data to GA4 using Stripe Webhooks and Server GTM Container.

  1. Install Stripe Payment Link Tag in Web GTM Container

    Download our Stripe Payment Link preset from GTM Presets library and upload to your Web GTM Container. This tag will decorate all Stripe Payment Links found on a given page with GA4 client_id as pass it as client_reference_id . This parameter will be added by Stripe to the webhook fired after purchase is made.

  2. Import and install Stripe Client in Server GTM Container

    Next install Stripe Client Server preset. This will create a custom server GTM client that can accept incoming webhooks and transform them into GTM event.

    This preset will also create additional Trigger called Server Event - Stripe Purchase that will fire when such event will be captured.

  3. Configure Google Analytics Tag in Server GTM Container

    Once Stripe Client and Server Event - Stripe Purchase are imported you can create or use existing Google Analytics tag to send purchase event to GA4.

  4. Setup Stripe Webhook

    Having all the setup done in both web and server GTM containers we can setup Stripe Webhook to call our Server GTM Container when a purchase is made through Payment Link (checkout.session.completed )