Lesson 4: Installing the tag code on your website
You have created a tag. Now add its code to all the pages of your website. The code is in the settings: click the gear icon.
Go to the Tag tab and scroll down to the bottom of the page.
If you run a CMS-based website, insert the tag code into the file used to generate the header of all your pages. In this case, the code is also inserted after the opening <head>
or <body>
tag.
If you have a popular CMS, you can use an official Yandex.Metrica plugin to install the tag code automatically. Usually, all you need to do is install the plugin and log in.
You can browse through our catalog to select a plugin for your CMS.
* A CMS is a Content Management System running your website. With a CMS anyone can upload texts, images, or videos to their websites (or remove them). CMS requires no programming skills to do this.
If the website is small and all its pages are individual files coded manually, place the code within the tags or each such file.
The higher you place the code in the text, the faster it loads and sends the pageview data. Even if the user closes the page almost immediately, the pageview is likely to be counted.
- Often a website uses multiple Content Management Systems. For example, one CMS maintains the website content while the other one runs the forum. Make sure to place the code in each CMS.
- Add the code to all pages of your website without any exception. If the code is missing from some pages, the user occasionally appears or disappears from Yandex.Metrica, and your statistics get distorted.
- If you change the settings for your Yandex.Metrica tag code, update the code on your website.
If users visit your website regularly, you can see your initial statistics almost immediately after you install the code. Usually the data makes its way to the reports within three minutes.