Custom Tracking Code to Order-Received Page

These are the instructions from a Partner on how to their tracking code in our Order-Received Page.

This a little over my head.

How do I accomplish this in XTheme.

Hi @danhirner,

Thank you for writing in, because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

Then use the following code, paste your tracking code replacing the <!-- Replace your JavaScript with this line --> line, and paste it on the child theme’s functions.php file:

function my_new_action() { 
  if (is_page(46) ) : ?>
    <!-- Replace your JavaScript with this line -->

 endif; }

add_action( 'wp_footer', 'my_new_action', 10 );

You can replace page id 46 with your specific page ID (thank you page). Here’s how you can locate your page IDs(

Hope it helps,

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.