Hi there,
I want to integrates Viewed Product event on my React App.
I saw this snippet in a docs

But I am not using the shopify theme for product page. I made a product page on my react app.
This is how I tried to convert it into the simple react code but it didn’t work

Can you please help me how can I add those code into my React app.