-
Notifications
You must be signed in to change notification settings - Fork 12
How URLs Are Shortened
The solution records the web address (the URL) of every file, page and link it sees, so that reports can group activity by location. Each address is kept in a field that holds up to 850 characters. Almost every real address is far shorter than that — but a handful are much longer, so the solution tidies them up before saving so they fit.
This page explains, in plain language, which addresses get shortened and how. The short version: nothing you care about is lost — the stored link still points at the right file or page, and your counts and reports are unaffected.
Looking for the database / upgrade side of this (why the field is 850 characters, how the upgrade runs)? See URLs Full URL shrink upgrade.
Storing each address in a fixed-size field lets the database look links up quickly, which keeps
reports fast even on very large tenants. The field also supports every language — including
non‑Latin scripts such as Greek — so an address like …/Καλημέρα κόσμε.pdf is stored exactly,
never garbled.
The limit is 850 characters. To put that in perspective, a normal SharePoint or OneDrive link is usually well under 200 characters.
Overwhelmingly, these are links opened from Microsoft Teams.
When you open a SharePoint or OneDrive link from inside Teams, Teams adds a long temporary tag to
the end of the address (the part after the ?). This tag — named xsdata — is often 600 to 1,100
extra characters of computer gibberish. Real-world examples have been 1,200–1,500 characters
long. The tag is:
- temporary — it is different every time the same file is opened, and
- meaningless for analytics — it tells us nothing about which file or page was used.
A few other things can occasionally make an address long (for example, "Safe Links" protection wrapping, or very long filter lists tacked onto a page address), but the Teams tag is by far the most common cause.
The solution only does as much as it needs to. If an address already fits, it is stored exactly as it is. If it is too long, it is shortened in this order, stopping as soon as it fits:
-
Remove the temporary Teams tag. The throwaway
xsdatatag is stripped off the end. On its own, this brings the large majority of long links back under the limit. -
Keep just the page address. If it is still too long, everything after the
?(and any#bookmark) is dropped, leaving only the part that actually identifies the file or page. Nothing of analytic value lives in that trailing part. - Trim to fit (last resort). In the very rare case that the plain page address is still over 850 characters, it is cut down to 850. In practice this almost never happens.
Here is a made-up (but realistic) Teams link to a file, before and after tidying. The values shown are illustrative only — they are not from any real tenant.
Before — what Teams produces (about 1,300 characters):
https://contoso.sharepoint.com/sites/Marketing/Shared Documents/Καλημέρα κόσμε.pdf?web=1&xsdata=<≈1,000 characters of temporary Teams tag>&sdata=AbCd1234
After step 1 — the temporary tag is removed, and it now comfortably fits (about 95 characters):
https://contoso.sharepoint.com/sites/Marketing/Shared Documents/Καλημέρα κόσμε.pdf?web=1&sdata=AbCd1234
If a link were somehow still too long, step 2 would keep just the page address:
https://contoso.sharepoint.com/sites/Marketing/Shared Documents/Καλημέρα κόσμε.pdf
- The stored link still opens the right file or page.
- You may notice that a stored link is shorter than the one you originally clicked — that is expected and intentional.
- Counts, totals and reports are not affected — the tidied-up address still identifies the same page, so activity is grouped correctly.
- Non-English links are fully preserved (e.g. Greek, and any other language).
- This tidying is applied wherever the solution records a link: file and page activity, link clicks, and Copilot file references.
The field described here is dbo.urls.full_url. Whenever the importer shortens or has to skip an
over‑long address, it writes a message to the logs naming the column and how long the value was, so
the event is easy to find and explain. The database-side change (converting the field to its current
size and indexing it) is covered in
URLs Full URL shrink upgrade.
- Home
- What data is collected
- The web portal
- Licence activity
- Copilot data & stats
- Architecture & costs
- App registrations setup
- Install with the installer
- Manual installation
- Private endpoints (optional)
- Certificate authentication (optional)
- Enable CSP for AITracker
- Verify the deployment
- Legacy SPO web setup