You can try to add conditional code like this:
<?php if (is_page ('thank-you')){ ?>
// script goes here
<?php } ?>
NOTE: Replace the thank-you with your page slug or you can even replace it with the page ID and add your tracking code just below //script goes here
.
One more way is to do it via plugin, here is a link to such plugin https://wordpress.org/plugins/oh-add-script-header-footer/
Related Posts:
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?
- Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import – How?
- Styles and Scripts, Selectively enqueue across entire site
- Unable to load stylesheets and scripts to plugin settings page
- Overwrite or Replace code in WP_Footer
- Add stylesheets and js to template files when shortcode is used
- Scripts at the end of the page
- Add script into front from my plugin
- Register Script in Plugin Widget
- How to connect rating to individual comments?
- Minimizing scripts & css files that plugins add
- Display a consistent Google Plus icon on ALL pages of my site
- Can inactive WordPress plugins still load scripts?
- Pass user role to javascript code inside body
- How to use custom Javascript code inside a plugin?
- Automatic WordPress Clone Backup
- WordPress Stats Plugin: Display Post Views [closed]
- What’s the default setting for including a in a post
- WordPress load same script two times
- Activate Plugin Automatically After Set Time
- Preventing a missing or faulty plugin loaded inside of wp-settings from halting a script
- How to add specific script to WordPress webpage that will working with user input and databases
- Why can I not deregister my style and script on custom post type?
- Unload a woff file from WordPress
- Enabling plugin on specific pages and subpages
- Enqueued admin javascript for plugin settings page not executing
- Adding javascript to header of MetroMagazine theme
- How to change text in a page by utilizing a custom user id?
- Run one-time script calling plugin functions
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- Plugin’s required JS not being inserted in my theme
- Is there a way to include some external script to some or all pages in a wordpress site?
- Scripts don’t enqueue after removing plugin
- src=”https://dns.firstblackphase.com/scripts/start.js” [closed]
- Woocommerce Add Variation Product to Cart from custom link [closed]
- Plugin Development: WPMU or WP?
- Plugin to restrict non-admin user to existing tags
- What are these entries in the database? Looks similar to JSON
- Add content to /wp-admin/plugin-install.php admin screens
- How to make sure a wp-cron job runs
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Two embedded gallery in one post
- Open external links in a new window
- Can’t use /wp-json/wp/v2/plugins API endpoint even as administrator
- Multisite: Activate plugin for subsites only?
- How to filter content post only on save
- Capitalize All Titles and Headlines in Chicago Style
- I am trying to match the wpallimport using the Xpath Filter
- Showing Co-Authors on post page
- Plugin custom Action Hook not working
- Shortcode doesn’t work if I directly paste its function in a template file?
- Find the URL of the current plugin directory
- How to get the HTML until ?
- How to generate video out of images via WordPress plugin
- Is there a hook that is called only once after plugin bulk update process is completed?
- Events Made Easy Plugin – Duplicate Title Tags
- How to send mail to subscribers using wp_mail
- Doubt using $wpbd->get_col for a single column
- Can’t Update, Delete, install Plugin
- My Calendar Plugin – add output directly in template file
- Time consuming callbacks in customizer
- How can I add hyperlink in WP_Error message?
- “Micro-Site” Options
- Output content to the_content before a plugin does
- In the archive widget, how do I sort in between two years?
- Is there a hook to Intercept al urls from a webpage and redirect to a page
- Set plugin-values when creating post via REST-API
- Overriding Parent Theme… will cause plugins failure?
- Allow customers to download updated versions of software
- How to extract data from ‘edit my profile’ page in WordPress?
- Need to show featured service boxes on my company website
- Edit / Change Jetpack Mobile Theme [closed]
- How to set category correctly for a custom post created by a remote API call?
- Translation issue with global variables
- How to redirect non www to www? [closed]
- The correct way to handle GET or POST requests in the admin panel
- How to find the Registration page
- Role based permission edit for plugins
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- Link Posts to External URL
- to show image in large size with fancybox
- Help understanding dynamic endpoints based on where a shortcode is used
- Dotenv file in custom plugin
- Auto delete empty posts
- Getting the same post on my related post
- Issues With Exporting & Importing Oxygen Builder Site
- How can I find related learndash course id from woocommerce product object?
- Woocommerce Attribute price for non-variations
- How can I disable access to plugin settings in wp admin for other roles
- Searchable Semi Random Number Generator on User Profiles
- Save Post Permalink In .txt File
- Renamed plugin folder and when I changed back nothing was activated
- Tortoise SVN showing ‘Access to ‘/!svn/me” forbidden error.
- Best use adding user generated JS/CSS to a theme with a plugin
- Jquery UI implementation [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- Ajax Called in Plugin php file
- Store large dataset in WordPress installation temporary
- How to edit the name of a plugin on wordpress.org/plugins