This article discusses advanced setup options in Sites, focusing on global scripts and sitemaps. You will learn how to add scripts that apply to your entire site, which is particularly useful for analytics and tracking purposes.
Additionally, the article provides guidance on sitemaps, covering how they function, when you need one, and how to generate, format, and submit your sitemap to search engines.
Sites are available to all account levels.
Table of contents
Global scripts
• Add global scripts
Sitemaps
• Do I need a sitemap?
• Automatically generate sitemaps
• Manually formatting sitemaps
• Submitting your sitemap to search engines
Global scripts
Ontraport Sites allow you to add global header, body and footer scripts. These code sections will add the code to all of the pages on your site. Here are some common reasons why you’d want to add global scripts to your site:
“I want to track performance with analytics.”
It’s important to understand how visitors interact with your website to make smarter marketing decisions. The ability to add global scripts means that you can add your GA4 (Google Analytics 4) or other tracking scripts globally. Tracking scripts ensure that every page view and event is captured, and you only need to add your code once into your site’s settings.
“I want to display consistent alerts or site-wide messages.”
If you have a holiday closure, a new product launch, or an urgent policy update, global scripts enable you to add a pop-up notification to all pages on your site. This messaging ensures that no one misses vital information. It’s also easy to update because when you are ready to remove or change the notification, you only need to do it once.
“I want to integrate third-party tools or services.”
Global site code streamlines integrations when you need to place third-party code on your pages. For example, if you use privacy and consent management tools to comply with GDPR laws, you can ensure that any page a visitor lands on your site will comply with regulations.
Add global scripts
You have the ability to add global header, body and footer code to your site.
- Go to Sites and click on one of your sites.
- In the General tab, scroll to the Sitewide code section and paste your code into the header, body or footer code sections.
- Click Save to apply your global script to the pages on your site.

Sitemaps
Back to top
A sitemap is a file that gives search engines like Google a list of all the pages on your website that you want them to know about.
Think of it like a directory or blueprint of your site. Instead of hoping search engines discover your pages by following links, a sitemap tells them exactly what’s there and what to pay attention to.
A sitemap helps with Search Engine Optimization (SEO) to help your site show up more often and higher up in results when people search for topics related to your business.
Do I need a sitemap?
Back to top
If your whole site is accessible through linked navigation, search engine crawlers should be able to find your pages just fine. However, sitemaps will constantly improve indexing for large or complex sites, as well as provide information about the files on your site.
Some other reasons why you may want to add a sitemap are:
New websites
Sitemaps can help you get your site discovered more quickly. New sites won't have as many links pointing to them, so a sitemap tells search engines your new site exists and to come check it out.
Content-heavy websites
Content-heavy websites are blogs, video or photo libraries, and educational sites. Sitemaps help prioritize your most popular or frequently updated content, allowing search engines to send more traffic to your most valuable pages.
E-commerce sites
Use sitemaps to drive traffic to specific product or category pages. You can prioritize your high-converting pages or make your seasonal pages appear at the top of your results so you can ensure your products appear
during key sales periods.
Membership sites
Sitemaps can prevent your protected content from appearing in search results. You can also exclude your thank you pages, internal duplicates, or any other pages you don't want to appear in results.
Managing SEO
Sitemaps give marketers complete control over which pages should be visible in search results. When you pair them with tools like Google Search Console or GA4, you can see which URLs are missing from the search, identify crawl errors or indexing delays, and troubleshoot ranking drops tied to your site's structure or recent changes.
Check out Google's recommendations on if you need a sitemap here.
Automatically generate sitemaps
From your site's settings, you can choose to automatically generate a sitemap. This is highly recommended unless you have a specific reason for not formatting your map.
Your account automatically adds new URLs to your sitemap as you build your site, up to a limit of 50,000 URLs. Once you reach that limit, new URLs won’t be added, but any existing URLs will still be updated if they change.
- Go to your site, and scroll down in the General tab to the Sitemap section.
- Toggle on the “Automatically update sitemap” setting.
- Save your site’s settings.
To include dynamic pages in your sitemap, go to the “Include these dynamic page types in my sitemap” section and click Add to choose the page types you want.
- If you just created your site, make sure to save your site’s settings first; this unlocks the option to add page types.
Although we will generate a sitemap for you, we cannot submit or resubmit your site map to search engines on your behalf.
Learn more about making your sitemap available to search engines in the Submitting your sitemap to search engines section below.
Manually formatting sitemaps
If you choose to format your sitemap, we recommend using the official resource sitemaps.org. You’ll find links to their documentation that will help you format your sitemap XML file to add to your Ontraport site settings.
- Use the sitemaps XML format provided by sitemaps.org.
When you are done formatting your site map, copy and paste it into the sitemap section of your Ontraport site and save your changes.
Submitting your sitemap to search engines
Back to top
Whether your sitemap is automatically generated or manually formatted, you’ll need to submit it to search engines so they can index it.
- Google provides several methods for you to submit your sitemap to them. Learn more about making your site map available to Google through their documentation here.
You may also consider adding your sitemap to Bing to ensure your site appears in Yahoo Search and Bing results.
- Learn more about submitting your site map via Bing’s webmaster tools here.