Duplicate Product URLs on Shopify Affecting Google Ranking

thanks for the replying. we have set :

{% if template == ‘product’ %}

{% elsif template == 'collection' %} {% elsif template == 'page' %} {% elsif template == 'blog' %} {% elsif template == 'article' %} {% else %} {% endif %}

in the head tag. and we asked google to verify index many many times. it’s not working. google search console still mark thousands of product as canonical. any idea how?