Understanding URLs for custom pixels

We’re using a custom pixel to submit conversion events to Posthog. A simplified version of our code looks like this:

analytics.subscribe("checkout_completed", (event) => {      
    posthog.capture('CHECKOUT_COMPLETED', {
      ...
    })
});

Our understanding is that checkout_completed should only ever fire when checkout is fully completed, at which point the customer is redirected to a ‘thank you’ / confirmation page.

However, in Posthog we’re seeing that the URLs recorded for these events vary significantly. For example:

  1. Thank-you page
    /web-pixels@73b305c4w82c1918fpb7086179m603a4010/custom/web-pixel-66584815@41/sandbox/modern/checkouts/cn/hWN1l3YOP8a4XBJ4jYQ46wPz/thank-you

  2. Processing page with completion param
    /web-pixels@73b305c4w82c1918fpb7086179m603a4010/custom/web-pixel-66584815@41/sandbox/modern/checkouts/cn/hWN1l2jgqVW5XYsKaVPfeLJb/processing?completed=true

  3. Checkout page with no completion indicator
    /web-pixels@73b305c4w82c1918fpb7086179m603a4010/custom/web-pixel-66584815@41/sandbox/modern/checkouts/cn/hWN1l2KPno5dX9FsPxkdAfeF?auto_redirect=false&edge_redirect=true&locale=en-GB&skip_shop_pay=true

Our questions are:

  1. Why do the URLs for the same event vary like this? We understand these may be internal sandboxed pixel execution URLs, but we’d like to confirm the reasoning behind the differences.

  2. Can you confirm that checkout_completed is only fired after a successful checkout?

  3. In particular, are there scenarios where this event might be sent on intermediate or processing pages before the customer actually reaches the thank-you page?

1 Like

Hey @sebastienpowell, thanks for reaching out on this.

What you’re seeing here is likely expected behaviour. There’s a bit more info in our docs here, but to confirm checkout_completed does only fire after the purchase finishes (usually on the Thank you page).

The differing URLs we’re seeing in this case are essentially due to how the sandbox environment of the pixel and the shop’s dynamic checkout flow might be working on a particular shop (for example, if a shop has post-purchase offer app/extension enabled for example). If there is a post-purchase app enabled, checkout_completed might be firing on that post-purchase page and wouldn’t fire again on “Thank You”, if that makes sense.

Hope this helps explain things a bit, let me know if I can clarify anything further or assist with some workarounds, happy to dig into this for sure.