Regardless of which version analytics tracking you use, depending on your location/audience, you may still legally need a GDPR cookie notice and opt in.
The Property creation process now defaults to GA4 (aka app+web) Properties.
If you do not want a GA4 property
Go to the Admin page where it lists your GA Account and the GA4 Property.
Click the +Create new property button at the top of the property column.
Once on the new Property Settings page, select the blue link Show advanced options to see and toggle on the Universal property options.
Select create Universal Property only.
Then click Next and complete the Property creation.
You will then be able to access the Universal gtag.js tracking code snippet in the Tracking Info section in the Property column. Alternatively, if you want to use Universal analytics.js use the following code snippet, swapping out your UA# where applicable.
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
Ref: https://developers.google.com/analytics/devguides/collection/analyticsjs
- Select the unwanted GA4 Property from the same drop down in the Property Column, go to its Property Setting page, and send it to the trash. The GA system will delete it from the system in 30 days.