Using dataLayer.push for event in wix

I want to use below code for passing an event in all pages of a wix website (it has to do with google tag manager):

dataLayer.push({
‘event’:‘VirtualPageView’,
‘virtualPageURL’:‘/services/gtm-training/thank-you’,
‘virtualPageTitle’ : ‘GTM Training - Contact - Thank You’
});

The virtualPageURL and virtualPageTitle parameters should take values depending on the page the user is on.

Does anyone know where this code should be placed and how it should be formatted?

Hello! I would take a look at this information on how to send tracking and analytics events.

And here is the trackEvent API documentation