How do I access the individual pages source code so I can put in my Google Analytics code for tracking? It needs to go before the </body> tag on each page.
How do I access the individual pages source code so I can put in my Google Analytics code for tracking? It needs to go before the </body> tag on each page.
Put it in your theme's footer.php file.
Is there any difference in simply putting the GA.JS tracking code into the footer.php vs using a google analytics wordpress plugin?
The end result should be the same, however using a plugin would mean you don't have to edit the theme.
I would personally use a plugin instead of editing the theme's file, especially if the theme you're using is one that's written by a third party and may be updated by them in the future.
I added the G. code to the footer.php but when I clicked on "update file" it erased all the code! Help! I was using the default theme, as I've just started the blog.
Then just download the original footer.php file to the site again, since it was lost. Then redo the edit.
This topic has been closed to new replies.