Best Sellers to XML Sitemap
Build an XML sitemap of your best-selling landing pages from a Google Analytics export, by transactions or revenue.
This tool needs the old Universal Analytics (pre-GA4) data format. It may still work with historical UA exports, but it does not work with GA4.
#about
Builds an XML sitemap of your best-selling landing pages, ready to submit to Search Console.
A Google Colab notebook reads a Universal Analytics landing page export in Excel and keeps the top 5% of rows (adjustable) by Transactions or Revenue.
Rows are kept in file order, so sort the export by your chosen metric first.
The homepage is dropped, and query strings are removed with duplicates merged.
Colab notebook
- Platform
- Google Colab notebook (runs in your browser with a Google account)
- Input
- GA landing page Excel exportDomain URL
- Output
- XML sitemap with top-performing product URLs
- Category
- E-commerce
Use cases
- Creating focused sitemaps for high-value products
- Monitoring indexation of revenue-generating pages separately
- Prioritising crawl budget on best sellers
- Excluding cart and account pages from sitemap
#features
- Jinja2 XML sitemap templating (protocol v0.9)
- Transactions or Revenue metric (export must be pre-sorted by the metric)
- Top percent threshold (default 5%)
- Pattern-based URL exclusion (checkout|basket|paypal|search|account|(not set))
- Query string stripping and duplicate removal on path
- Priority 0.80 on every URL; lastmod is a filler date series starting today
#how-to-use
- Export GA landing page report as Excel (sheet Dataset1, Universal Analytics format)
- Sort the export by your chosen metric (the top percent filter follows file order)
- Set your domain, metric and top percent in the notebook
- Run all cells and upload the export when prompted
- Download high_value_landing_pages.xml
- Submit to Search Console
#faq
- What exact input file does it expect?
- A Google Analytics landing page report exported as Excel; CSV is not accepted. The notebook reads a sheet named Dataset1 and needs a Landing Page column plus a Transactions or Revenue column. This is the legacy Universal Analytics export format (Behaviour > Site Content > Landing Pages), so a GA4 export needs reshaping to match.
- Do I need to sort the export before uploading?
- Yes, sort it by your chosen metric first. The notebook sorts by the metric but then keeps rows by their original file position (the index is not reset), so the top X percent is effectively taken in the order the file arrived, not by transactions or revenue. Pre-sorting the export by the metric makes the filter behave as intended.
- Why does it error when I select Revenue?
- The metric column is cast with astype(int), so currency symbols, thousands separators or decimal values in the Revenue column raise an error. Clean the column to plain whole numbers before uploading.
- What happens to URLs with query strings?
- Only the path is kept: query strings are discarded during URL parsing, anything after an ampersand is cut, and rows are deduplicated on path. Parameterised landing page variants therefore collapse into one clean URL, and the homepage path (/) is always excluded along with checkout, basket, paypal, search, account and GA's (not set) rows.
- Where do the lastmod dates come from?
- They are not real modification dates. The notebook assigns a date series starting today and incrementing one day per URL, so most URLs get lastmod dates in the future. Treat lastmod as filler, or edit the XML if your consumers care about it. Priority is hardcoded to 0.80 for every URL.
/contact
Want me to run this for you? I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.