Installing Google Analytics
Google Analytics is the big dog when it comes to tracking site visitors. Installing it in eZ Publish is quite a simple task.
After signing up with Google Analytics, we were given some simple JavaScript code to place on every page we want to be tracked. In eZ Publish, the pagelayout template represents the basic layout of all pages in a given siteaccess. Therefore, all we had to do was place the code at the bottom of that template and it will be loaded on all site pages! Now we can access useful information such as who is visiting our site, how they got here (did they directly type our address? did they come here from another link? did they use a search engine and if so, what keywords did they use?), which pages they viewed, and more.
On ezsystems.ca, because we use the Website Interface, the pagelayout template is found at extension/ezwebin/design/ezwebin/templates/pagelayout.tpl. After we added the code, we cleared the eZ Publish cache (using the Clear cache window on the right of the Administration Interface). That's all!
So that all of us at the eZ Systems North America office can access the statistics, we used the Google Analytics Access Manager. The link to the Access Manager is found at the bottom of the welcome page after you log into Google Analytics. There, I added the Google accounts of my co-workers (the screenshot shows only me, but everybody else is there now):
Need more advanced Google Analytics management for your eZ Publish site, especially if you have a webshop? Check out Graham Brookins' Google Analytics extension.
Comments
Adding GA to each page so that your clients can update it.
Benjamin Bertrand
Friday 26 October 2007 02:23:14 pm
An object containing Google Analytics code?
Peter Keung
Monday 29 October 2007 11:44:20 am