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

Where to paste Analytics tracking code in a Wordpress site

  1. EmpressFelicity profile image83
    EmpressFelicityposted 5 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. 0
    Website Examinerposted 5 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 image83
      EmpressFelicityposted 5 years ago in reply to this

      Automation - sounds like the way to go!  Ta

  3. kerryg profile image87
    kerrygposted 5 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 image60
    HRogerposted 5 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 image83
    EmpressFelicityposted 5 years ago

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