Yes there is. There are several options however. You can either add a property to the web part on which you widget is based or use an existing property. Then you'll need to go to the widget's configuration and make the field visible in the configuration form.
Let's say I've decided to use the Web part title property for my purpose. This is a system property and thus I'll go to the widget configuration > system properties and enable the field for configuration. However this doesn't make the ID necessarily unique. To ensure the uniqueness I'd suggest providing your own value by a Macro. You could generate a GUID or have something more sensible like {%CurrentUser.UserName + "_" + CurrentDocument.AliasPath |(identity)GlobalAdministrator%} or along these lines. Given you'll only have one of those per document per user it is unique enough.
Let me know if that helps.
Vilém