0
votes

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

2

2 Answers

2
votes

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.

1
votes

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:

  1. Use a plugin as DFTR suggests
  2. Copy the Twenty Eleven footer.php to Twenty Eleven child directory on your server and edit the child theme footer from wordpress.