Google Analytics

Google Analytics works beautifully with alahup!.

Here is the code to paste in your main template file.

in templates/main.tpl :
{dynamic}
 {if $smarty.const.AH_STATUS eq 'published' && $smarty.const.AH_PRODUCTION && not $smarty.cookies.alahup_nolog}
// your code start here
 <script type="text/javascript"></script>
 <script type="text/javascript"> _uacct = "XX-XXXXX-X"; urchinTracker(); </script>
// your code ends here
 {/if}
{/dynamic}

Replace the appropriate code with the one which you are given from Google Analytics when you register a new site.

  • {dynamics}{/dynamics} make sure this part of the template is not cached.

  • We also make sure the page "pings" Google Analytics when it's from the published version of the production site, and we also don't want to send data when the 'alahup_nolog' cookie is set (you can install this cookie from the site's stats/prefs.