This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

How to add google analytics code Manually in the footer

Resolved 4 replies premiumthemetheme-vantage
10 years ago · Last reply by vikramp 10 years ago

Hi there,

How can I add google analytics code MANUALLY in the footer (or header) without using a plugin?

In the Dashbord / Design / Editor I have only access to the (child) style.css. No access to footer.php or header.php …

I’m an absolutely wordpress newbie, so this question is also for better understanding how the child theme is working.

Thanks for your help

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

4
  1. Daniel Staff 10 years, 11 months ago

    Hi Jürgen

    First of all ensure that you have a WordPress Admin Access/Account.

    Copy the tracking code. Go to your WordPress Admin and then Appearance > Editor.

    Open your theme’s header.php file and directory underneath the tag, paste the tracking code. Click “Update File”.

    That’s all that is required.

    To confirm that it is working, go back to your Google Analytics account. Click on “Admin” at the top of the page and under “Property” choose your site and then click “Tracking Info”.

    If the Tracking Status is “Receiving Data,” then you have successfully added Google Analytics to your site.

    Cheers

  2. Jürgen 10 years, 11 months ago

    Thanks.

    Meanwhile I figured out that I first have to copy the header.php and footer.php from the main theme into my child theme folder. Then I can edit the footer or header.php as discribed. Thank you Addo.

    Bye

  3. Andrew Misplon Staff 10 years, 11 months ago

    Hi Jürgen

    Super, glad that did the trick.

    If you decide you want to go the plugin route I quite like this plugin:

    https://wordpress.org/plugins/googleanalytics/

    It’s super simple, just one field for your tracking ID.

    All the best.

  4. vikramp 10 years, 2 months ago

    You have correctly pointed out the steps to add google analytics code to theme, but if theme is upgraded user have to do it again so its better to add by creating a simple plugin. You can refer http://techosaurs.com/how-to-add-google-analytics-to-wordpress/ for steps on how to add google analytics code using a simple plugin.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread