How to filter on variants on a collection page in the dawn theme

I have added the liquid code to display product variants on my collection pages. I have also added a metatag filter on the variants, however, when on the collection page the filter displays but all products are returned regardless of what metatag option I choose. How do I filter at the variant level on a collection page?

@Alan15 i followed your instructions to add the variants to the collection page.

If you want to filter at the variant level, you must use metadata that is on the variant level such as product option, and variant metafield. Trying to filter on tags won’t work.