Question

I want to setup a Shopify Webhook on the Order Cancellation event that will cause some javascript code to be run.

In this specific case, I want to send a negative transaction to Google Analytics to remove the transaction when an order is cancelled (as described here: https://support.google.com/analytics/answer/1037443?hl=en )

I have my callback url / page setup (PHP) and it works correctly when loaded in a browser. But the webhook apparently (obviously?) does not trigger any client side code to run.

Any ideas on how I can make this happen?

Was it helpful?

Solution

Although this does not solve the question specifically (of running javascript via a webhook) an alternative solution for this specific case would be to use Server Side Google Analytics tracking to send the negative transaction:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top