Reputation: 521
I need to paste some Google Analytics code into my WordPress site. It's the latest WordPress theme, with some modifications.
I would like the Analytics code to track every page on the WordPress site.
Where do I paste the Analytics code?
I was told to do the following to find the place to paste the Analytics code:
--- In WordPress Admin, click 'Appearance'. --- Click 'Editor'. --- Click on "footer.php". Scroll to the very bottom of the text area. Find the < /body? line and right above it, add/paste your Analytics code.
But when I click 'Editor', I don't see "footer.php"....
This is what I see when I'm logged into WordPress Admin: https://skitch.com/richardclunan/fxsmg/dreamweaver
And this is the site that I want to add Google Analytics code to: Richard Clunan -- Copywriter
Upvotes: 0
Views: 2328
Reputation: 1
To add Google Analytics to your WordPress site, you can go with these simple steps are as follows:
Enter your WordPress login information
Select Appearance
Theme Editor. After that
Click the Theme Header (header.php) file, which is located on the right side under the Theme Files section.
Paste the tracking code you just copied from your Analytics profile before the closing tag.
Then click Update File.
Upvotes: -1
Reputation: 2896
You are editing a child theme, it does not have all the files, only the files that are different from the parent. On the top right side switch to the parent theme called 'Twenty Eleven' in this case. Edit its footer.php
However, word of caution, if you update the theme through wordpress, the google analytics code would be gone. Possible work arounds for are:
Upvotes: 1
Reputation: 869
It is much easier to just download the "Google Analytics for WordPress" plugin. You can search for it from your dashboard "plugins" section and it updates all your new pages / post pages automatically. Otherwise you're stuck pasting code into each new page you make.
Upvotes: 2