1

It's a VERY simple site though, and I have no interest in the more advanced stuff that gtag.js seems to offer. Also I don't want to have to have a GDPR cookie notice.

Is it possible to still use an older analytics.js snippet? If I could find a UA-xxxxxx identifier in the new property I'd just try with that, but all I can find is a "measurement ID" once I've created a web-traffic gtab (G-xxxxxxx) and a "stream ID" - xxxxxxxxxx.

Thank you!

1 Answer 1

2

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

  1. Go to the Admin page where it lists your GA Account and the GA4 Property.

  2. Click the +Create new property button at the top of the property column.

  3. Once on the new Property Settings page, select the blue link Show advanced options to see and toggle on the Universal property options.

  4. Select create Universal Property only.
    enter image description here

  5. Then click Next and complete the Property creation.

  6. 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

  1. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.