Request for Guidance on Displaying Survey (Hotjar) on Thank You Page with Checkout Extensibility

We’re currently transitioning to the new Checkout Extensibility framework and would like to continue showing a customer survey (powered by Hotjar) on the order status/thank you page after checkout completion.

Previously, this was possible via the Additional Scripts section in the Shopify admin. However, with Additional Scripts being deprecated and the new checkout environment using sandboxed iframes, external scripts like Hotjar can no longer load or trigger surveys directly on the thank you page.

Could you kindly advise:

  1. What are the recommended alternatives to load or trigger a third-party survey like Hotjar post-purchase using Checkout Extensibility?
  2. Is it possible to pass a custom flag or event that can be picked up on the next page visit (e.g., homepage) to conditionally display a survey?
  3. Does Shopify offer any native Web Pixel or analytics APIs that can be used for triggering client-side scripts securely outside of the checkout sandbox?

We’re looking for a solution that complies with the new Checkout Extensibility model but still allows for post-purchase customer feedback collection.

Thank you in advance for your guidance.

1 Like

Hey @Muhammad_Luqman :waving_hand: - thanks for reaching out! With Scripts being deprecated, you’re correct that it does make it a bit trickier to create post-purchase flows like surveys.

One avenue to look into would be a post purchase UI extension if you haven’t looked into that yet: Build a post-purchase product offer checkout extension

This would limit reusing Hotjar’s survey exactly as it is now I believe, since extensions “live” inside the sandboxed iframe environment, so the script couldn’t be injected, but you could theoretically rebuild a survey within the post purchase UI extension if you wanted to look at that as an option.

The post purchase UI extension framework is also still in an early access state, so any live shop does need to request access to the feature in order to enable it in production, and at the moment UI extensions are only available to Plus shops (just thought I would mention this even though you are already using a Plus feature with scripts)

For passing custom flags to trigger surveys on next page visits - the sandboxed extension doesn’t directly pass info like that over to my knowledge, but I’m curious about what you’re trying to set up there for sure! Are you looking to delay the survey or only show it to specific customer segments, etc?

Hope this helps and hope to speak soon as well, happy to help out with this :slight_smile:

To successfully trigger surveys provided by Hotjar, we need to ensure the following script runs outside of the sandbox environment:


<script>
  (function(h,o,t,j,a,r){
      h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
      h._hjSettings={hjid:id here,hjsv:6};
      a=o.getElementsByTagName('head')[0];
      r=o.createElement('script');r.async=1;
      r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
      a.appendChild(r);
  })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>

We’re looking for the best solution to ensure this script (or the survey trigger) runs reliably on the thank you or order status pages, considering the limitations of Checkout Extensibility and the deprecation of Additional Scripts.
Appreciate any recommendations. Thanks!

Hey @Muhammad_Luqman :waving_hand: - just following up as I was able to get some confirmation on this. At the moment, we don’t support injecting scripts into checkout extensibility features, but we do have a method for creating a post-purchase survey extension if you did want to look at that as an option: Add a survey to Thank you and Order status pages

I don’t know how well this will integrate with the current Hotjar script, however this would be the supported method going forward at the moment.

If you did need to migrate from Hotjar, there are some additional post-purchase survey apps available here if you’d like to take a look at those as an option.

I definitely understand this isn’t the most ideal, but I hope this helps a little bit at lerast :slight_smile: