URL fragments appear at the end of a URL and begin with a hash (#) character followed by any text. A URL fragment is typically used to mark a portion of a webpage, and we can see URL fragments on websites which dynamically update their page(s).
What do I mean by "dynamically updating"?
For instance: you go to some website page and start scrolling, when you reach to the bottom of that page - suddenly new content loads in, and you can continue scrolling. If you look at the URL (see Figure below), you will notice that the page path received a URL fragment, in this case its #page1. If you continue, you may reach URL fragment #page2, #page3 etc. while the page didn't reload. Actually, the page dynamically added new content!
If one has a default Scroll Depth tracker on such page (to track Visitors engagement), it reached 100% at the moment of the first dynamical update, and one will never know whether Visitors got to the page with URL fragment #page2, #page3 or even #page42. So, in order to track Visitors engagement on a page which is dynamically updating we will not use Scroll Depth tracker, but instead we will track URL Fragments!
To track URL Fragments, you will need to do few things in GTM:
Get Path With Fragment
History Change Trigger
Data is like the Universe, vast and powerful