Below is the code to add to your page. You must place this code before the HubSpot tracking code or this will not work.
Once you have this enabled, you can then edit your Chatflow and target only URLs containing query parameters of "known=true" to show the flow to only known contacts or "known=false" to show the flow to only unknown contacts.