What is your website platform.?
It depends. How did you create your website? Did you use any CMS like Wordpress or something similar?Hello,
I want to start using Yandex Metrics on my website. In order to do it I have to Install the code snippet on the site, but I do not have any experience with coding.
Maybe there any other, simpler way to do it?
You can do it with a plugin or edit code inUps, forgot to mention. Wordpress
Appearance -> Theme Editor -> footer.php -> add code above </body>
Locate wp-content/themes/yourthemename/header.php and add it just before head ends. Should do the job.Ups, forgot to mention. Wordpress
Then use theme options and paste your code in the header / footer box.Ups, forgot to mention. Wordpress
Thanks for so detailed answer. Just want to doublecheck.Locate wp-content/themes/yourthemename/header.php and add it just before head ends. Should do the job.
If you are using a third party theme, create a child theme -> copy header.php to the child theme, and do the same as above; but in the child theme's header.php.
Nopes not there, you can paste it in line 16, or just before you see </head>, or press enter after line 29, and paste it there.Thanks for so detailed answer. Just want to doublecheck.
I have to paste my code right here?
![]()
Do you mean in line 15? Because line 16 is after </head>Nopes not there, you can paste it in line 16, or just before you see </head>, or press enter after line 29, and paste it there.
That's the start of head.. It is <head> tag. The end is </head>.Do you mean in line 15? Because line 16 is after </head>
Atleast with GTM, adding it in the header helps detecting some issues like bounce. If the user opened the page, but exited before the page could load (generally happens because of slow connection, or other render blocking script).. it will catch that. In </body>, it might not.Out of curiosity, why do you all suggest adding code in header instead of footer?
I guess that makes sense, but as a general rule I prefer to load the content first. Otherwise the visitor gets a lot of dead time waiting to load every script.Atleast with GTM, adding it in the header helps detecting some issues like bounce. If the user opened the page, but exited before the page could load (generally happens because of slow connection, or other render blocking script).. it will catch that. In </body>, it might not.![]()
P.s., not to mention, other scripts except for analytics/metrics etc should always be loaded before </body>
I installed my code after line 29, but it still not workingNopes not there, you can paste it in line 16, or just before you see </head>, or press enter after line 29, and paste it there.
Caching probably? Try clearing it (including any dns caching you might have through cloudflare). Also look in the source code if that code exists (ctrl + u) in your site html. If it does, then you are probably not being detected as an user because of dnt request/ ad blocker.I installed my code after line 29, but it still not working
![]()
maybe do you know what could be a problem?
Yup, cleared cache helped. Thanks a lot!Yup it will also work there. Some bounces might not be detected, but it will work for sure.
Caching probably? Try clearing it (including any dns caching you might have through cloudflare). Also look in the source code if that code exists (ctrl + u) in your site html. If it does, then you are probably not being detected as an user because of dnt request/ ad blocker.