Installing google analytics code on wordpress blog

Since your question is about installing the google analytics code in WordPress, I will highly recommend you to install the UA-XXXXXX-X tracking code before the closing head tag “</head>“. Just edit the theme header.php file.

You don’t need to create a child theme unless you are using someone else’s theme that could potentialy be updated or ask you for an update from which your tracking code will be deleted.