This guide illustrates how to implement Thematic XML Sitemap for more relevant search results.
Why implement Thematic XML sitemap
In the context of Thematic Pages, Bloomreach offers an XML sitemap feature that generates an XML sitemap of all the Bloomreach Thematic Pages created for your site.
We recommend that you implement the thematic XML sitemap feature to optimize search results for your Thematic Pages and enhance their visibility on search engines.
Deployment Prerequisites
- Firstly, you must choose a thematic URL pattern for your site.
- Now, your Bloomreach TPM prepares sitemap files, sends you the location to retrieve the files, and shares when to deploy your thematic page XML sitemap. On each (desktop and mobile) of the Bloomreach endpoint, there will always be two or more files:
- One Index file
- One or more map files, depending on the number of live Thematic Pages
Generally, you’ll receive multiple map files if you have more than 50,000 live Thematic Pages. Let your TPM know if the files we send to you don't match your expectations.
How to deploy Thematic XML sitemap
Follow the deployment steps listed below:
1. Fetch sitemap files
Fetch the files daily from the location that your TPM sends to you. Please follow the steps below in the given order.
1.1 Fetch the index file
Index files specify how many site map files exist on your site. The initial API call to fetch the index file is https://core.dxpapi.com/fetch_thematic/{$account_id}/{$auth_token}/prod/desktop/v2/th-sitemapIndex.xml.gz
This call returns data like this
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://www.example.com/plp/thematic/th-sitemap-0.xml.gz</loc>
<lastmod>2023-11-22T08:27:06+00:00</lastmod>
</sitemap>
</sitemapindex>
You must download each of the stated site map files.
1.2 Fetch the map files
There may be one or more sitemap entries depending on the number of Thematic Pages you have. Simply take the name from the last subfolder per map ("th-sitemap-0.xml.gz" in this case) and insert it into your API call.
The content of the file will be similar to this
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/plp/thematic/kings-front-load-washing-machine</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/plp/thematic/ken-washing-machine</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/plp/thematic/ken-steam-washer</loc>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
</urlset>
New integrations have just one URL in map files
If you're integrating Thematic Pages for the first time, then your maps contain just one URL i.e. your site's homepage. Your launched Thematic Pages are added to your map files after your Thematic Pages integration is live.
2. Copy fetched files
Copy your index file to your site's root folder. Copy the map files to the root of your site's Thematic URL pattern. All of your map files go to the same location. We recommend that you retrieve and copy files daily for optimal performance.
3. Share the files’ location with search engine
Please follow the steps below in the given order:
3.1 Edit your site's robots.txt file to add a sitemap entry with the location of your index file. For example:
Sitemap - http://example.com/popular/th-sitemapIndex.xml.gz
3.2 Add the URL of your index file in Google's Search Console.
Your files are ready to be indexed and crawled for faster, more relevant search results. Let your TPM know when you're done so we can verify your deployment.
FAQs
- Is an uncompressed file available instead of a compressed file?
Sitemap files are delivered compressed, following the guidelines of major search engines and bots. If you need to decompress the files, then we recommend that you do so programmatically as part of the API call you use to download your sitemap files.
- What are the naming conventions for the sitemap files?
We use the following naming conventions for your sitemap files:
Suppose your index file is th-sitemapIndex.xml.gz.
Then, the map file is th-sitemap-#.xml.gz, where # varies depending on the number of map files needed for your sitemap. The value of # starts at 0 for the first map and increases by 1 for each additional map file. Your first map file is th-sitemap-0.xml.gz.