How to use the advanced settings for Shopify codes
If you need to specify more advanced settings for generating your discount codes, you can use the Advanced settings dialogue. This allows you to specify all properties available in Shopify's API. This is an advanced setting and requires that you perform tests to make sure that the codes are generated correctly.
Only allow the discount to work on specific collections
The "entitled_collection_ids" property allows you to specify one or more collections that the discounts will be entitled to. To set this property, you enter the collection ID(s): "entitled_collection_ids":  or if you have multiple: "entitled_collection_ids": [12345, 6789]
You can find the collection ID by browsing to the collection in your Shopify admin portal where you can see the collection ID in the URL:
According to the Shopify documentation on this property, you also need to specify "target_type" and "target_selection" if you decide to use "entitled_collection_ids". The three properties you need to change are the following:
Here's how it would look in the advanced settings: