Richard
Richard

Reputation: 521

Google Analytics and WordPress -- I can't find the right place to paste the code into

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

Answers (3)

Kbizsoft Solutions
Kbizsoft Solutions

Reputation: 1

To add Google Analytics to your WordPress site, you can go with these simple steps are as follows:

  1. Enter your WordPress login information

  2. Select Appearance

  3. Theme Editor. After that

  4. Click the Theme Header (header.php) file, which is located on the right side under the Theme Files section.

  5. Paste the tracking code you just copied from your Analytics profile before the closing tag.

  6. Then click Update File.

Upvotes: -1

Ibrahim Muhammad
Ibrahim Muhammad

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:

  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.

Upvotes: 1

DFTR
DFTR

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

Related Questions