Monday, May 24, 2010

How to add the new Google Analytics tracking code into Thesis

The new google analytics tracking code is supposed to go after the opening <body> tag and Thesis, as of version 1.7, only has an option in the admin area to add the tracking code just before the end of the HTML, which places scripts just before the closing </body> tag.

To get the analytics tracking code onto your Thesis site, just after the opening body tag, add the code below into your custom functions file to add the new version of the Google Analytics tracking code (as of May 24, 2010).


function google_analytics() { ?>

Paste your analytics tracking code here

<?php }

add_action('thesis_hook_before_html', 'google_analytics');

No comments:

Post a Comment

Only comments in English will be considered. Thank you!