How to add @id field to a snippet

Since version 2.4.0 it’s now possible to add a customized @id-field to each global snippet. Just edit a global snippet and scroll down to the JSON+LD metabox as shown below.

WordPress Metabox with a field for the @id value of a snippet
Edit the @id value.

Normally, search engines expect an URL with a hashtag here. So you can add the {url} placeholder to replace it with the current page URL. For example, if the snippet get’s included into the page https://this-is-my.site/whatever/ and you define the @id value as {url}#product then the full @id value would be https://this-is-my.site/whatever/#product.