Note: This article applies to Composer users! See "Adding a user tracking code (Page Manager)" for the Page Manager version of this technique.
Many websites, such as Facebook or Hubspot, allow you to monitor your site users' browsing habits so that you can improve your own website to deliver what users are looking for. This is usually done via "tracking code" (sometimes called a "tracking pixel"), short snippets of programming that you can copy from a website and paste onto your own site pages. The page on your site where tracking code(s) are pasted determines what sort of information you can glean about site usage patterns.
Start by going to the service or platform whose tracking code you want to use. Often, these sites will have dedicated pages that deliver a unique snippet of code for you to use on your site. Copy this tracking code to your clipboard, then follow these instructions for placing the code in the appropriate location(s) on your own site. The site where you obtain the tracking code will usually tell you exactly where to paste the code on your site pages; this article includes instructions for placing tracking code in:
The <head> tags of specific, individual site pages
Before the close of the <body> tag on individual site pages
All site pages
If the tracking code needs to be placed only on one page (or a group of specific pages), follow these steps.
Inside the <head> tag
Click on the page you want to place the tag on.
Click on the pink gear “Page Settings” icon.
Go to the “SEO” tab and paste the code in the “Custom <head> Content” area.
Before the </body> tag for a single page
Add an Embed element at the bottom of the page and paste the code in the element settings.
If the tracking code needs to be placed on all pages of your site, follow these steps.
Inside the <head> tag for all pages
Use the “External Assets” section under your site's Themes.
Don't forget to click “Update” once you have pasted the code.
Before the </body> tag for all site pages
Use your site's bottom banner/footer.
Navigate to the “Banners” section of your site in Composer.
Choose your “default footer.” (If there are multiple bottom banners, the code will need to be placed on all of them.)
Add an Embed element to this footer and paste the code there.