Page 1 of 1
Tracking Static Pages Using Google Analytic Plug-in
Posted: Mon Apr 30, 2007 9:13 pm
by Maccsta
Hi, I have just installed the Google Analytic plug-in and I'm wanting to track static pages that I have created on my blog.
Do I need to add the address of each page I have created in the list -"Hosts you use for your blog"? It's just showing my blog address at the moment.
Any help would be much appreciated. Thanks
Re: Tracking Static Pages Using Google Analytic Plug-in
Posted: Wed May 02, 2007 11:06 am
by garvinhicking
Hi!
Using the google analtics plugin, you cannot track individual static pages. The option you refer to only concerns the hostname, not individual pages.
To track individual items, you will need to remove the plugin and instead edit the templatefile 'index.tpl' of your template and manually add the javascript for analytics, and use IF-Branches to check which one to use, basically like this:
Code: Select all
{if $staticpage_pagetitle == 'My first staticpage'}
... analytics code #1 here ...
{elseif $staticpage_pagetitle == 'Second staticpage'}
... analytics code #2 here ...
{else}
... analytics code #3 here ...
{/if}
Use the appropriate analytics JS code in those places, and replace the proper staticpage pagetitles with the ones you really have.
Also remember that if you copy+paste javascript, you need to replace { with {ldelim} and } with {rdleim} to prevent smarty parsing errors. You you might need to put the whole javascript block in a {literal}...{/literal} block.
HTH,
Garvin
Posted: Thu May 03, 2007 9:11 pm
by kleinerChemiker
i think static pages should be tracked like normal pages.