I need to get the customer id on the “thank_you” page. I’m expecting either a liquid script {{ order.customer.id }} or javascript window.Shopify.checkout.customer_id to store this information.
There are 2 issues:
-
The post purchase scripts (settings → checkout → “Post-purchase page”) aren’t running
-
The customer id is null on the “thank_you” page
Steps to reproduce:
Order status page script:
<script>
console.log("order status");
console.log("{{ order.customer.id}}");
</script>
Post Purchase Page script:
<script>
console.log("post-purchase");
</script>
result:
This is the “thank_you” page. I’m expecting the post purchase script to run and there to be some reference to the customer id in either liquid or global shopify object. Inspecting window.Shopify results in only null’s for customer data.
Upon reload of the page, the “order status” page, the customer id appears from liquid:
Any insights would helpful. Thanks

