title: Add custom script in woocommerce refund hook
body: <p>I'm trying to execute a tracking script every time a refund gets processed in woocommerce but for some reason it's not working.</p>
  
  <pre><code>add_action( 'woocommerce_order_refunded', 'custom_order_refunded', 10, 2 ); 
  function custom_order_refunded( $order_id, $refund_id ) {
  if ( $order_id &gt; 0 ) {
  $order = wc_get_order( $order_id );
  $order_number = $order-&gt;get_id();?&gt;
  &lt;script&gt;
  gtag('event', 'refund', { "transaction_id": &lt;?php echo $order_number;?&gt; });
  &lt;/script&gt;
  &lt;?
  }
  }
  </code></pre>
  
  <p>I tried executing it with a static value instead of the $order_number variable to see if it was running and nothing... I'm lost</p>