Where to embed HubSpot code?

Hi there, I want to put a cookie on the site to track when people click to our site from an email.

HubSpot is telling me to “Copy and paste this tracking code into every page of your site, just before the tag.”

Where exactly would I do this in Cornerstone?

Thanks,
Jena

Hi Jena,

Hope you’re well today.

First, you will have to install and activate the child theme. You can get it from here:

https://theme.co/apex/child-themes

Once it is activated, login through FTP then go to wp-content/themes/x-child then edit the functions.php file then add this code:

add_action('wp_footer','custom_script');

function custom_script() {
?>
    <!-- Add the code here -->
<?php
}

Please place the code in the <!-- Add the code here --> part.

Hope this helps.

Thanks, that helps a bit. I’m still really unclear about how parent and child themes work. Do you have any resources that can help me learn more about how they work and when I need them?

Thanks,
Jena

Hi Jena,

Sure! Please check this article which contains details information and explanation about child themes:

Basically, it is a good practice to have a child theme installed and activated before you start working on the site just in case you will need to add some custom code or edit the main theme files just like in this case. Making changes to the child theme is important because if you directly edit the files of the parent theme, those changes will disappear if you update the theme.

Here are some more articles about child themes:



Hope these help.

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