WordPress.org

Forums

Twenty Twelve
google analytics - where to put code? in twenty twelve (8 posts)

  1. twinoaks
    Member
    Posted 2 years ago #

    Hi

    I want to put the Google Analytics script ito my website.I've looked around an it's either in the header.php or footer.php that seems to be the place.
    As I'm using Twenty Twelve theme with child theme.So I have put the code into the footer.php on the main site not the child but it does not show up in Google.
    So can someone point me in the right direction,please

    Kevin

  2. paulwpxp
    Font hero
    Posted 2 years ago #

    There are 2 hooks available for that, and most themes have these hooks.

    wp_head()
    http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

    wp_footer()
    http://codex.wordpress.org/Function_Reference/wp_footer

    Anyway, most of WP sites use SEO plugin that takes care of this stuff for you.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the parent Twenty Twelve theme. Add your script to the child's footer.php file.

  4. twinoaks51
    Member
    Posted 2 years ago #

    But the child's does not have a footer.php file? That's the confusion for me.

  5. paulwpxp
    Font hero
    Posted 2 years ago #

    Read on Template Files and Using functions.php
    http://codex.wordpress.org/Child_Themes

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    Copy the parent footer.php file into the child and edit the child's copy.

  7. twinoaks51
    Member
    Posted 2 years ago #

    Ok thanks I'll do that later. Off out now.

  8. twinoaks
    Member
    Posted 2 years ago #

    Hi Guys

    Thanks I've sorted my problem. Where to put the Google Analytics script ito my website.

    Kevin

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic