Text
Extract domain, clean URL, and page slug from web URLs
Strip ?utm query parameters, isolate the hostname after "://", and pull the final URL slug for SEO and analytics audits.
Strip query parameters before slicing URL paths
Analytics exports often append tracking strings like "?utm=email" to landing page URLs. Stripping everything from "?" onward via IFERROR(TEXTBEFORE(A2, "?"), A2) removes the query string for this chosen reporting view.
From there, TEXTBEFORE(TEXTAFTER(clean, "://"), "/") extracts the hostname, and TEXTAFTER(clean, "/", -1) extracts the trailing page slug.
Removing all query parameters can merge genuinely different pages; it does not establish a canonical URL. These formulas assume simple absolute URLs without credentials, ports or fragments. The first formula extracts the authority segment, which is a hostname only under those assumptions. A trailing slash produces an empty last segment; a root URL without a slash has no page slug.
| PageUrl (A) | Hostname | Trailing Slug |
|---|---|---|
| https://sheets.arte-soft.com/guides/sumifs-dates?utm=email | sheets.arte-soft.com | sumifs-dates |
| https://arte-soft.com/pricing | arte-soft.com | pricing |
Authority, query-free URL, and slug formulas
Use IFERROR(TEXTBEFORE(afterProto, "/"), afterProto) when root homepage URLs like "https://arte-soft.com" have no trailing slash.
=LET(u, IFERROR(TEXTBEFORE(A2, "?"), A2), p, TEXTAFTER(u, "://"), IFERROR(TEXTBEFORE(p, "/"), p))Trailing page slug formula
Stripping "?utm=email" first ensures the slug is "sumifs-dates" rather than "sumifs-dates?utm=email".
=LET(clean, IFERROR(TEXTBEFORE(A2, "?"), A2), TEXTAFTER(clean, "/", -1))Try the example
Use the original values or change them to test your understanding.