Custom URL template for urlSync

I’m interested in working with the urls generated by urlSync more deeply. First, I’d like to specify my own template (referenced here and here). But, I’m not fully grasping how to use the connectors api to achieve this.

Second, I’d like to also generate the hash of the url for use as a unique ID with our back-end system to allow our content team to do some merchandising on specific results pages.

I’m sure I can achieve both of these once I understand the connectors api better. I wasn’t able to find any examples for the urlSync logic specifically.