Click a cited source in some Google search features and you may land halfway down a page with a sentence highlighted in yellow. Look at the address bar and you will see something odd at the end of the URL: #:~:text= followed by encoded words. That is a text fragment, and it tells you exactly which passage Google wanted the reader to see.
For SEO teams, that highlight is valuable. It shows which sentence on your page was judged to answer the question. The catch is that analytics tools were never designed to capture it, and browsers deliberately hide it from page scripts. This guide explains how text fragment links work, what your analytics can and cannot record, and a practical way to analyse the cited passages anyway.
We keep the claims tight. Some behaviour, such as exactly when Google adds fragments to AI Overview links, is not formally documented, so we label what is official and what comes from practitioner testing.
Key Takeaways
- A text fragment (
#:~:text=) tells the browser to scroll to and highlight a specific passage on the page. - Google documents that featured snippet clicks scroll automatically to the quoted section; practitioners report similar fragment links from AI Overviews.
- Browsers strip the fragment directive during page load, so page scripts and standard analytics tags usually cannot read it.
- Fragments are never sent to your server, so they do not appear in server logs either.
- The most reliable way to study cited passages is to collect the links directly from the search features and decode them.
What a text fragment link is
Text fragments are a browser feature, not a Google invention. MDN describes the syntax as #:~:text=[prefix-,]textStart[,textEnd][,-suffix]. The :~: part is called the fragment directive. Everything after it is an instruction for the browser, not part of the page address.
| Part | Example | What it does |
|---|---|---|
| Fragment directive | #:~: | Marks the start of browser instructions |
| textStart | text=core%20web%20vitals | Highlights the first match of this text |
| textEnd | text=human,URL | Highlights a range from the first word to the second |
| prefix- / -suffix | text=avoid-,use | Disambiguates which match to highlight |
| Multiple passages | text=Causes&text=linked | Highlights several passages at once |
Matches are case-insensitive, strings are percent-encoded, and browsers that do not support the feature simply ignore it and load the page from the top. MDN also notes that text fragments only run on user-initiated navigations in the main frame, and that Chromium-based browsers let sites opt out of the scroll behaviour with the Document-Policy: force-load-at-top response header.
Where Google uses highlighted links
Google's featured snippets documentation describes the behaviour without naming the technology.
“Clicking a featured snippet takes the user directly to the section of the page that appeared in the featured snippet.”
— Google Search Central, Featured snippets and your website
The same page says the scroll happens automatically without any annotation by the site, and that the click goes to the top of the page if the browser cannot support it or Google cannot pinpoint the location.
For AI Overviews, Google's public documentation does not describe link formats. Practitioner write-ups, such as a Search Engine World guide first published in October 2025 and updated in January 2026, report that AI Overview links can carry the same #:~:text= pattern, and that not every click includes it. Treat that as observed behaviour that may change, not a guarantee. Our guide to getting cited in AI Overviews covers the content side.
What analytics can and cannot capture
Here is the core problem. Browsers deliberately hide the directive from the page.
“…stripped from the URL during loading so that author scripts cannot directly interact with them.”
— MDN Web Docs, Text fragments
That design protects privacy, because a highlighted phrase could reveal what someone searched for. It also means your GA4 tag, which reads the page URL through JavaScript, normally records the clean URL without the fragment.
| Data source | Sees the text fragment? | Notes |
|---|---|---|
| Server logs | No | URL fragments (everything after #) are not sent in HTTP requests |
| GA4 page_location | Normally no | The directive is stripped before scripts run |
| Performance navigation entry | Documented as no | MDN says text fragments and other directives are stripped from the entry's name |
| Custom GTM variables reading performance entries | Sometimes reported | Practitioners report partial capture; results may vary by browser and version |
| Search Console | No | Reports pages and queries, not passages |
| The user's address bar | Yes | Visible to the visitor and kept if they copy the URL |
Some guides describe a Google Tag Manager trick that reads the URL from the browser's performance navigation entry and extracts the text= value. MDN's current documentation for PerformanceNavigationTiming says text fragments are stripped from that URL too. If you try the method, test it in the browsers your audience actually uses, treat any data as a partial sample, and make sure it fits your consent setup. Our guide to GA4 events explains how custom parameters are sent if you do capture something.
How to analyse the passages AI features cite
Because analytics is unreliable here, go to the source. The method below is manual but dependable.
- Pick your pages. Start with pages that show impressions in the Generative AI performance report. Our post on AI data in Search Console explains where that report lives.
- Build a query list. Use the queries those pages already rank for, plus the questions customers ask.
- Run the searches and collect links. In an AI Overview or featured snippet that cites you, copy the link address rather than clicking it.
- Decode the fragment. Paste the part after
text=into any URL decoder, or usedecodeURIComponent()in your browser console, to get the cited words. - Log the passage. Record the query, date, feature, page and decoded passage in a spreadsheet.
- Find the passage on the page. Note its heading, its position and its format: definition, list item, table row or step.
- Look for patterns. After 20 or more examples, compare cited passages with uncited ones on the same pages.
- Repeat monthly. AI answers vary, so a single check is a snapshot. Our AI citation audit framework explains how to schedule repeat checks.
Patterns worth looking for
- Is the cited text a direct answer in the first sentence under a heading? Our guide to answer-first writing explains why that structure helps readers and machines.
- Is it a row in a table or a step in a list? See AI-friendly tables and lists.
- Does it include a number, a date or a named entity?
- Is it a self-contained passage that still makes sense out of context? Our post on content chunking discusses this, though Google's own optimisation guide says you do not need to restructure content into special "chunks" for its AI features.
Should you opt out of highlighting?
Usually not. The scroll takes the visitor straight to the answer they wanted, which is a good experience. If a highlight lands on something misleading out of context, fix the content first. Document-Policy: force-load-at-top only stops the scroll in Chromium browsers; it does not stop Google from citing the passage. Snippet controls such as nosnippet and data-nosnippet limit what Google can show, and Google's AI features documentation lists them as the way to limit content in Search, but they can also reduce your visibility.
Common mistakes
- Expecting to see fragments in GA4 by default. They are stripped before your tag runs.
- Searching server logs for them. Fragments never reach the server.
- Treating partial GTM data as complete. Any capture method only sees some visits.
- Ignoring copied links. If visitors share a highlighted URL, the fragment travels with it, which can make one passage spread on social channels.
- Rewriting a page around one cited sentence. Citations vary between runs. Look for repeated patterns first.
- Forgetting landing page data. Combine passage notes with AI referral landing page analysis to see whether cited pages also drive visits.
Related Guides
- AI Overviews and AI Mode in Search Console: What You Can and Can't See
- Why AI Answers Change Every Time (and How to Measure Anyway)
- Share of Voice in AI Answers: How to Calculate It
Frequently Asked Questions
What does #:~:text= mean in a URL?
It is a text fragment. It tells the browser to scroll to and highlight the matching text on the page. It is not part of the page address sent to the server.
Can GA4 track text fragments from Google?
Not by default. Browsers strip the fragment directive before page scripts run, so GA4 normally records the clean URL. Some custom methods report partial capture, but results vary.
Do AI Overviews use text fragments?
Google documents automatic scrolling for featured snippets. For AI Overviews, practitioners report links with the same pattern, but Google does not formally document the link format, so it may change.
Can I stop browsers highlighting text on my site?
Chromium-based browsers respect the Document-Policy: force-load-at-top header, which stops the automatic scroll. It does not stop search features from citing your content.
How do I find which sentence Google cited?
Copy the link from the search feature, decode the part after text=, and match it to your page. Log examples over time to spot patterns.
Conclusion: the highlight is a clue worth collecting
Text fragment links show you which sentence a Google feature chose, but browsers hide that detail from analytics by design. Collect the links manually, decode them, and use the patterns to shape clearer pages. If you want help turning those findings into better pages, our on-page optimization service can take it from here. Request a free quote to get started.
References
- MDN Web Docs: Text fragments
- MDN Web Docs: PerformanceNavigationTiming
- Google Search Central: Featured snippets and your website
- Search Engine World: How to track traffic from AI Overviews and featured snippets in GA4 (Oct 2025, updated Jan 2026)
- Google Search Central: AI features and your website
- Google Search Central: Optimizing for generative AI search




