How to add Google Analytics to the website code?
Copy the tracking code and place it on all pages of the website or in the file responsible for the formation of templates for all pages (in the footer or header after the tag).
3 ways to add a tracker to the website
1. Manually via FTP
It’s just elementary! Go to the server and find the file with the tags, add the code right under this file. Such file is often called Header.php (example for WordPress).
2. With a plugin
There are a large number of extensions for different engines (for example, Google Analytics WordPress), the installation of which takes a matter of seconds. You just have to copy the script to the plugin settings page - and you're done!
3. Via Google Tag Manager
Go to https://www.google.com/analytics/tag-manager/ , add a new account and click next. Then specify the name of the container and the location where the analyzer will be used (this can be AMP, website, iOS or Android). Click on the "Create" button - you will see the agreement on the use of the tag manager.
It remains only to agree to the terms of the company, and after that you will see both fragments of the code; the first must be inserted on the site into the section as close to the beginning as possible, and the second after the opening tag.
Having dealt with the tag manager, we proceed to install the tracker. The easiest way is to import the container through administration and then replace the identifier in the "Value" field with your own analogue.
How to check that everything works correctly?
After you add the Google Analytics counter to the site, go to the service account. Select the “Reports” tab, and then “Real-time”, then go to your resource in the second tab.
If the report displays information about one visitor, it means that there are no errors, and you coped with the task!
For the same purpose, you can use a special browser extension.
Installing Google Analytics on different CMS
WordPress
To integrate the script, just go to the admin panel, and then select "Appearance" and "Editor". Find the template file you need and paste the counter code after the opening tag in header.php. opencart
Go to the "Add-ons" section by selecting the "Analytics" subcategory. After that, click on the icon next to the name of the tracking system and add the resulting script there.
Joomla
Select "Extensions" in the admin panel and go to "Template Manager". After checking the box next to the desired option, click "Edit HTML". This is where the code needs to be placed.
Bitrix
We advise you to add the module as close to the top of the page as possible in a dedicated and connected area.
MODx
Go to the "Elements" section, then to "Elements Management", "Templates". Next, you need to open each template in turn and insert the tracker code there. A more convenient solution is to add the script to the header chunks.
Tell us what you think
By clicking 'Submit', you agree to Privacy Policy and authorise our staff to contact you. You are liable under the Personal Data Protection Act if you key in false personal data or other people’s personal data.
offers and news