How to include custom JavaScript code in post purchase (final checkout pages)

Our Shopify app includes two custom JavaScript codes: first to capture and store Google click ID (gclid) if present in URL (if visitor comes from Google Adwords ad) and second one to send this gclid to our API in order to bind it to order for performance statistics. We achieved this by ScripTags, but recently we were notified that ScripTags are old and should be replaced with App Embeded Blocks (https://shopify.dev/apps/online-store/theme-app-extensions/extensions-framework#app-embed-blocks). We can use App Embeded block for the first script (to store gclid in cookie), but those blocks do not work in checkout pages. We were trying to use Post Purchase Checkout Extensions (https://shopify.dev/apps/checkout/post-purchase), but it looks like this options does not allow us to include custom script, only DOM elements, available from "

@Shopify_77 /post-purchase-ui-extensions-react".

So the question is how can we pick up stored gclid from cookie, get order ID and send it to our API on final page of checkout.

Shopify team replied to this request to our contact email and informed that script tags can be used to add custom javascript to checkout pages. For everything else we continue to use app embedded blocks.

How about now, when they also deprecate the use of scripttags in checkout pages and you need to use ui-extensions?
I can’t figure out, how to add javascript (like ) using their extension render function) :disappointed_face: