WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] word press and google analytics (7 posts)

  1. gavinandbeth
    Member
    Posted 1 year ago #

    Hi,

    I am really new to this. I've created a website and would like to add Google Analytics. I need to enter my GA code onto my WP site and I think I understand that I need a functions.php file. Its supposed to be located in my theme directory, but I have no clue where to find the theme directory.

    Please help!

    Thanks.

  2. SpeedWebDesign
    Member
    Posted 1 year ago #

    Hi there,

    If you get your Google Analytics code you can insert it in your header file...

    WordPress/wp-content/themes/YourTheme/header.php

    I would advise adding it just above the closing <head> tag, so find this:

    </head>

    And replace it with this:

    Your Analytics Code Here (as provided by Google)
    </head>

    This should do it for you :)

  3. gidd
    Member
    Posted 1 year ago #

    Theme directory is inside WP-Content/themes/your_theme_name/

  4. gavinandbeth
    Member
    Posted 1 year ago #

    Thanks for your replies, but I don't know where to find either one:

    WordPress/wp-content/themes/YourTheme/header.php
    WP-Content/themes/your_theme_name/

    Will this be located in a folder on my computer, on the word press site, or in my website page?

    Thanks again!

  5. olavxxx
    Member
    Posted 1 year ago #

    Hi, you can edit the file via the control panel -> Appearance -> Edit.
    Then choose the page top / header.php on the right side.

    Remember to make a local backup of the contents before you edit :-) Save it in notepad on your local pc before editing.

  6. gavinandbeth
    Member
    Posted 1 year ago #

    Thank you! Thank you! Thank you!

  7. gidd
    Member
    Posted 1 year ago #

    You find it inside your hosting space. When you buy a hosting, they give you access to control panel (usually cPanel). After you login, use the file manager and browse to public_html folder. You will find wp-content inside this folder if you install WordPress in the root directory.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.