Skip to content

Instantly share code, notes, and snippets.

@brandalismo
Created March 21, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandalismo/dd9dddc411ad6941c1b7c3c8e0ff74e2 to your computer and use it in GitHub Desktop.
Save brandalismo/dd9dddc411ad6941c1b7c3c8e0ff74e2 to your computer and use it in GitHub Desktop.
/*
* REALIZAR SEGUIMIENTO DE CONVERSIONES DE FACEBOOK
*/
function woo_facebook_pixel_tracking( $order_id ) {
$order = new WC_Order( $order_id );
$order_total = $order->get_total();
?>
<script>fbq('track', 'Purchase', {'value':'<?php echo $order_total ?>','currency':'EUR'});</script>
<?php
}
add_action( 'woocommerce_thankyou', 'woo_facebook_pixel_tracking' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment