Best Sellers to XML Sitemap
Generate XML sitemaps from GA landing page exports filtered by top transactions or revenue.
#about
Creates XML sitemaps (protocol v0.9) from Google Analytics Excel exports using Jinja2 templating.
Filters to top X% by transactions or revenue (rows are kept in file order, so the export must already be sorted by the chosen metric), excludes URLs matching patterns (checkout, basket, paypal, search, account, plus GA "(not set)" rows), removes duplicates, and assigns 0.80 priority.
Ready for Search Console submission.
Jupyter notebook
- Platform
- Jupyter Notebook (requires Python environment)
- 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.