• Hi,
    I am new to wordpress but bought a site which is now up and running, however I always use Google analytics tracking code. I need to set the code on each page I want to track, I am only interested in tracking my homepage.
    Being used to HTML with my other sites I don’t have a problem but with wordpress I do not have a clue where to insert the code.

    As I mentioned earlier in this post I am completely new to this and to be honest I don’t have a clue where to look, usually I would have looked for an index file and inserted the code there.

    Can anyone help?

    Best regards

Viewing 1 replies (of 1 total)
  • Hi

    look in your theme’s /wp-content/themes/{themename}/footer.php file.

    In most themes that will be the file you want to edit. In there you should see the closing body tag </body> that Analytics code is typically placed before.

    Since you only want to track your homepage, I suggest doing it like this

    <?php if ( is_front_page() ) { ?>
     ===== paste Analytics code here =====
    <?php } ?>
    </body>

Viewing 1 replies (of 1 total)

The topic ‘How do I insert Google Analytics gode into my homepage’ is closed to new replies.