Send purchase event facebook in woocommerce throught GTM
Here’s an example of how you might add the code to retrieve the purchase value in the functions.php file: <?php add_action( ‘woocommerce_thankyou’, ‘add_transaction_total_to_data_layer’ ); function add_transaction_total_to_data_layer( $order_id ) { $order = wc_get_order( $order_id ); $transaction_total = $order->get_total(); ?> <script> dataLayer.push({‘transaction_total’: <?php echo $transaction_total; ?>}); </script> <?php } ?> This code will add the purchase value…