jump to last post 1-5 of 5 discussions (6 posts)

Where to paste Analytics tracking code in a Wordpress site

  1. EmpressFelicity profile image74
    EmpressFelicityposted 7 years ago

    OK, so I've created a lovely new shop in Wordpress using the Crafty Cart theme.  I have created a report for it in Google Analytics, and pasted my Google Adsense ID using Adsense Optimizer.

    But I'm a bit baffled about where to paste the Javascript tracking code that Analytics created for me.  It says something about putting it immediately before the closing  tag - which is where???

    Any help would be greatly appreciated.

  2. profile image0
    Website Examinerposted 7 years ago

    There is an excellent Analytics plug-in for Wordpress that automates the process. This way you won't have to enter code at all - just for your information.

    1. EmpressFelicity profile image74
      EmpressFelicityposted 7 years agoin reply to this

      Automation - sounds like the way to go!  Ta

  3. kerryg profile image88
    kerrygposted 7 years ago

    Yeah, there's several plug-ins that will do it for you.

    Just in case you decide to do it manually instead, go to the Theme Editor and find the file named something like footer.php, then paste the code right above the /body html tag.

  4. HRoger profile image61
    HRogerposted 7 years ago

    Hey there, well there are two ways that you could add analytics to your wordpress manually or with a plug-in:

    Doing it the manual way

       1. Well first Login wordpress admin panel
       2. Then go toGoto Appearance > Editor (theme editor)
       3. Now Select the footer.php or index.php
       4. Look for and find the </body> html tag
       5. Copy and page the Google Analytics code before the </body> tag. Make sure its before that tag big_smile
       6. Now click Update File to save all the changes you made.

    But if you swap wordpress themes you will loose your  Google Analytics tracking. That is why the plugin is the better option.

    Adding Google Analytics with the Header or Footer plugin

       1. Download and install the Header-Footer plugin
       2. Goto Settings > Header-Footer
       3. Cut and paste the google tracking code in the bottom footer textbox.
       4. Enjoy.

    Hope it was helpful big_smile

  5. EmpressFelicity profile image74
    EmpressFelicityposted 7 years ago

    Ah, so it's the footer where it goes!  Thanks Kerry and Hroger.