How to implement tracking scripts in different Shopify pages?

Hello,

for our new project in central Europe, we are planning to work with an email marketing automation saas that is tracking people´s behavior while browsing and shopping and tailoring emails to their history.

Part of the tool´s implementation is to add tracking scripts into different pages on our Shopify store. I managed to put the main tracking script into theme.liquid before the closing body

But they also want us to put bunch of different scrips such as:

<script type="text/javascript">
 Targito.push( 'event', '', { 'id' : 'PRODUCTID'} );
</script>

where PRODUCTID should be replaced by our variantID.

OR

<script type="text/javascript">
Targito.push( 'event', 'category_view', { 'id' : 'CATEGORYID'} );
</script>

where category ID should be replaced by collection.id

The question is, how do I use liquid variables in javascript and where shall I add this script into liquid as product liquids don´t have closing , no? The same for category pages?

Thank you al for your help, I really appreciate it.