Google Analytics shows where your visitors come from and what they do on your site. You can add it through the template settings, with no code editing.
Before you add it
Google Analytics sets cookies, and many countries require you to ask visitors first. Check what applies to your visitors, and use a consent tool if you need one. If you add the code as shown here, it runs for every visitor, with no consent step.
Step 1: Get your tag from Google
- Sign in at Google Analytics and create a property for your website.
- Follow Google's steps to create a web data stream.
- Find the installation instructions for the stream and copy the Google tag. It starts <script.
Step 2: Add it to your template
- In your Joomla administrator, select System, then Site Template Styles, and select your template.
- Open the header and footer custom code tab.
- Paste the tag into the field for the template header.
- Select Save & Close.
Then check your site in Google Analytics' Realtime report. Read more about the header and footer code settings.