How to add Google analytics code manually

Hy everyone, i read almost the entire threads speaking about how to do that, but when I go to my child theme in wp dashboard in Costumization/Theme editor i have only style.css file no functions.php…

The theme child setup i think is good, so how can i fix this issue?

Thank you for your help!

Hi Michael,

Thank you for writing in, your child theme (or any other theme) should have a functions.php file, else it will not work. Please see your x theme files via FTP or cPanel to see if your child theme does not really have a functions.php file. You can see that under the \wp-content\themes\x-child directory.

An easy way of adding Google Analytics code to your site is by using the Google Analytics extension or Insert Headers and Footers plugin (3rd party).

Hope it helps,
Cheers!

Thank you a lot for the answer. Let me, please, ask you something Friech… i explore the dicrectory of the x-child theme but i only have the style.css file… so, what happend if i copy and paste the only functions.php file of x-theme father with the google analytics code in the x-child directory?

@The_Mountain,

In a standard child theme, there should be a style.css and functons.php file. You can check and download our X Child Theme here and here’s a guide on how to add the Google Analytics via functions.php.

Hope that helps.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.