Tracking code for kartra

Hi,
I need to add a tracking code of Kartra to one of my pages (not all).
Where do I best add it to not so that it fires accordingly but I don’t lose track of it?

Thank you!
Nimue

Hi Nimue,

Thank you for reaching out to us. Your code looks like a simple HTML image element, if that’s the case then edit the page where you need to add the tracking code in Cornerstone, add Classic Raw Content element and paste the code inside.

Alternatively if you have a complex code than just an image tag, you can use child theme to add the code. First find your page ID where you want to add the tracking code (see https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59) then in your child theme’s functions.php file, paste the following code:

function x_add_tracking_code() {
		if ( is_page("62") ) {
  			echo "Your code here";
		}
}
add_action('x_before_the_content_begin', 'x_add_tracking_code');

Where as 62 is the page ID and replace Your code here with your actual code Hope this helps!

1 Like

Thank you very much, this was very helpful!!!

You’re welcome!
We’re glad Nabeel’s solution works out for you.

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