There are several different ways to add a Google Analytics tracking code to your Uncode-based website.
Theme Options
To install Google Analytics please create a new tracking code from the Google Analytics website, copy the tracking code ID, and paste it into the dedicated fields in Theme Options. You can choose to enter your tracking code in the fields:
- Theme Options → CSS/JS → JavaScript
- Theme Options → CSS/JS → Tracking (possible exclusion with the Privacy Plugin)
These fields are very similar and you can choose which one to use based on your needs. The difference is that if you use the Tracking field it's possible, combined with the Privacy Plugin, to exclude the codes until the explicit consent of the user. We invite you to visit the dedicated Privacy Plugin documentation page for more information.
Google Analytics 4 (GA4)
This is an example of the Google Analytics 4 tracking code, note that you need to replace 'G-XXXXXXXXXX' with your Google Analytics ID:
<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX'); </script>
Google Analytics Anonymize IP
Unlike the old version of Google Universal Analytics, in Google Analytics 4, IP masking is not necessary since IP addresses are not logged or stored.
Plugins
Alternatively, you can use some free WordPress plugins to add the tracking code to your Uncode-based website. There are other plugins that can add the tracking code to your website that are not mentioned here. This doesn't mean they are not compatible with Uncode. Just try what you find will work for you best:
Comments
0 comments
Article is closed for comments.