Something like that, yes. When you visit any URL on the site, we use javascript to rewrite the URL in the location bar with a shortened, unique, trackable URL. So we know both what URL you came in through, and the new URL that we then assigned to you. With this we can track every click all the way back up through the tree to the initial click, even if you just copy/paste the URL or hit the button on your phone to text the page to a given contact. Where possible, we also track any link preview engines that visit the URL, so we can usually tell not just that you shared, but how you shared (skype, telegram, iMessage, gmail, facebook, twitter, etc.).
I initially wrote this system so that I could retarget through Facebook ads people that had previously shared viral news articles, but now we have found great applications for it in ecommerce and lead gen as well.