Thank you for your reply. I believe Google Ad Manager is different from Google Adsense. Right now, I’m just using Google Adsense. Could you please help me how can I make it work on my site?
Yes they are different, but GAM also handles the same ads as AdSense.
But in that case simply use Google Tag Manager, which will allow you to embed any scripts (ads, analytics, etc.) all from a single tool. And it requires no configuration other than setting your ID in the configs.
Google has amazing documentation on how GTM works, and the packi I linked before also explains very well how to implement it.
However I have no idea how to handle ad placement with AdSense in React, but I’m sure there are React packages for that.