Archive for the ‘Analytics & Statcounters’ Category

FAQ: Where does my Statcounter code go?

Friday, February 8th, 2008

If you’re using Statcounter to track your hits, this is where you insert the tracking code:

In your WP Admin area, go to “Design” (”Presentation” in old versions of WP) –> “Theme Editor” and open up the file called “Header (header.php).” Insert the code right AFTER this line:

<body class="<?php sandbox_body_class() ?>">

Then save your changes.

Related post:  Adding Google Analytics tracking code to your blog

Where do I insert my Google Analytics code?

Sunday, January 6th, 2008

Because a WordPress blog is a dynamic, database-driven site, there’s not a simple place to insert the Google Analytics tracking code. Fortunately, however, some clever people have created free plugins that will insert your Google Analytics code everywhere it needs to be without you ever touching the template files. The plugin I use can be found here, but you can also google “wordpress plugin google analytics.”

If you use the one I linked to above, just extract the folder and upload into your “plugins” folder, inside your “wp-content” folder. NOTE: with that particular plugin, you need to use the “legacy” urchin.js tracking code, not the newer fancier one. In your google analytics control panel there will be an option to copy the urchin.js version or the newer one. Make sure you use the urchin.js one for this plugin.

Once you’ve uploaded the plugin, activate it from within your WP Admin area under the “Plugins” tab. Then, under “Settings” (”Options” if you’re on an older version of WordPress) and you should see a “Google Analytics” link in the submenu. Click on it, and past your code into the box and then click save.

Related Posts: Uploading and Installing a Plugin, Adding Statcounter tracking code to your blog