Home Forums WoodMart support forum How to add custom script to the thank you page Reply To: How to add custom script to the thank you page

#597842

metrocomdev
Participant

I added the following code to the functions.php file. I’m unsure if this is the correct approach, or if there might be a better solution you can suggest:
function add_facebook_pixel_script() {
if ( is_order_received_page() ) {
?>
<!– Meta Pixel Code –>
script here
<!– End Meta Pixel Code –>

<?php
}
}
add_action(‘wp_head’, ‘add_facebook_pixel_script’);