• Hello,

    My website is for a sales organization that I run. I have a CRM system set up to monitor and track leads and sales and stuff. The CRM has a Webpage Tracker. It gave me some code and the instructions were to “Copy this code in to your HTML code after the body tag.” I am not all that savvy when it comes to this stuff and I didn’t want to mess anything up. Can you tell me how I go about entering this code and where do I go to enter it. Thanks for your time and help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could use a Child Theme, copy your footer.php file into it and modify that file with your cody directly after the closing body tag </body>.

    Or you can add code using a function within your Child Theme functions.php file, like so:

    function after_closing_body() {
        // Your custom code here
    }
    add_filter( 'wp_footer', 'after_closing_body' );

    If you simply opened up your active theme footer.php file and just added your code after the closing body tag, when you update the theme in the future, your custom code changes will be overwritten – this is why it should be done using a Child Theme.

    If you’re using a custom made theme then modifying the footer.php file is perfectly fine.

    Hope this helps.

    Thread Starter brianmckoy

    (@brianmckoy)

    could I just add the code after the closing body tag in the footer.php file for now and when I update the theme I can just do it again? Thanks.

    If you wish to do so, then yes you can.

    could I just add the code after the closing body tag in the footer.php file for now and when I update the theme I can just do it again?

    You can, but it’s not recommended. Mainly because you will forget. ?? I know that from experience… (yes, I’ve done that myself many times!). Using a child theme will mean that you don’t have to remember anything, and your tracking won’t suffer any down time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Web Tracking Code’ is closed to new replies.