Execute js from linked file on product page only

Hello,

I use a linked liquid.js to manage custom scripts on my site.

I’d like to execute one of the scripts only if the page is a product page, no matter what the template.

I tried several ways:

{% if product %}

{% if template contains ‘product’ %}

{% if page.request_type == ‘product’ %}

and others with no luck.

What is the proper way to check if the page is a product? I’m just approaching liquid and flow control.

Thank you

I guess I found it: {% if template == product %}

I’ll use OR statemente if I’ll create new product templates