Google Analytics extension v1.0.0 INSTALL

Introduction
============

1. What is the Google Analytics extension?
   ------------------------------------------------

   Google Analytics is a true eZ publish extension
   that provides the fetching and submission of information 
   from client browser back to google like page view 
   statistics and order purchase statistics.

   For more information about this extension please read the README file.

2. License
   -------

   Google Analytics extension is licensed under the GNU General Public License.

   The GNU GPL gives you the right to use, modify and redistribute
   Google Analytics under certain conditions. The GNU GPL licence
   is distributed with the software, see the file doc/LICENCE.
   It is also available at http://www.gnu.org/licenses/gpl.txt

   Using Google Analytics under the terms of the GNU GPL is free of charge.

   For more information or questions please contact
   license@brookinsconsulting.com

3. Requirements
   ------------

   The following requirements exists for using Google Analytics extension:
 
   o  eZ publish version:

      Make sure you use eZ publish version 3.4 or higher. Recommened 3.9.1. Tested with 3.10.0

   o  PHP version:

      Make sure you have PHP 4.4.2 or higher. Recommended 4.4.6. Tested with 4.4.2

   o  eZ publish must be reachable from the internet:

      Make sure you have installed eZ publish on a webserver
      that is reachable by the Authorize.Net service.

   o  A Google Analytics Account

      You can obtain a Google Analytics Account for testing at no cost (free)

     Requirements
        ------------------------------
        1. You must have an Google Analytics Urchin Account ID.


Getting eZ publish
==================

You can download a version of eZ publish from ez.no,
you will find the various versions at:

http://ez.no/download/ez_publish/ez_publish_3_stable_releases

Note: You will require eZ publish 3.9.1 or higher

Information on the installation of eZ publish can be found at:
http://ez.no/products/ez_publish_cms/documentation/installation
and
http://ez.no/doc


Installing Google Analytics extension
==============================================

1. Copy the package into the `extension' directory
   in the root of your eZ publish installation.

2. Unpack the files in the distribution. The command
   necessary is depends on the file you downloaded.
   [tar.gz]:
   $ tar -zxvf googleanalytics-1_1_0.tar.gz
   [zip]:
   $ unzip googleanalytics-1_1_0.tar.zip

3. We must now enable the extension in eZ publish.

   To do this edit site.ini.append(.php) in the folder
   root_of_ezpublish/settings. If this file does not exist;
   create it. Locate (or add) the block

   [ExtensionSettings] and add the line:
   ActiveExtensions[]=googleanalytics

   If you run several sites using only one distribution
   and only some of the sites should use the extension,
   make the changes in the override file of that siteaccess.

   E.g root_of_ezpublish/settings/siteaccess/shop/site.ini.append(.php)
   But instead of using ActiveExtensions you must add these lines instead:

   [ExtensionSettings]
   ActiveAccessExtensions[]=googleanalytics

3.5 Quick Page View Stats Configuration

   Place this template code into your own pagelayout.tpl template.

   {include uri="design:google/analytics/stats.tpl"}

   Continue with the settings configuration. 
   Be certain to specify your Urchin account code setting.

4. We must now configuration Google Analytics

   You will need to edit the googleanalytics.ini.append.php file and put
   in your urchin id. Alternately you may create an override copy of this file.

   If you run several sites using only one distribution
   and only some of the sites should use the extension,
   make the changes in the override file of that siteaccess.

   E.g root_of_ezpublish/settings/siteaccess/shop/googleanalytics.ini.append(.php)
   But you will need to edit these lines:

   [GoogleAnalyticsWorkflow]
   PageSumitToGoogle=enabled
   OrderSubmitToGoogle=enabled
   HostName=disabled
   Urchin=UA-0420420-7x
   TestMode=disabled
   DebugMode=disabled


   Note:
   ==============================
   To switch Google Analytics mode from test to live,
   thus turning test mode off.

   Open the file googleanalytics.ini.append(.php)
   and switch "TestMode=enabled" to "TestMode=disabled".

   Make sure you have the proper settings in your
   Google Analytics account control panel.


5. Workflow & Trigger Setup
   ===========================
   A) In the eZ publish admin, go to Setup -> Workflows
      and click New Workflow Group.

   B) Name the group something like "Shop" and click OK.
      The group will be added to the workflow groups.

   C) Click on the group you have just created, and in the
      Workflows box click the "New Workflow" button.

      1) Name the workflow "Reciept".

      3) You will now see an Event select dropdown.
         1) Select "Event / Reciept"

         2) Confirm you choice by clicking the "Add Event" button
            just to the right of the select dropdown.

      4) Enter a description "Google Analytics Reciept Workflow Event Template View"

      5) Save modifications.

      6) Clear All Cache via both the administration gui and cli script.

   G) Now click on the Triggers link in the left hand menu.

      In the table "Workflow Triggers" you will see a list of available triggers.

      On the line: shop, sheckout, after, (Workflow Drop Down)
      "Click" the dropdown select the reciept event you have just created.

      Click Apply changes Button to save your trigger selection modifications

   H) Clear All Cache via both the administration gui and cli script.

   I) After you have followed all these steps, the extension's
      workflow settings should be activated, configured and functioning properly.

6. Shop Checkout: Testing Workflow & Trigger Setup
   ===========================
   After completing the above setup you should login to eZ publish
   add a product to your basket, proceed to checkout, enter your
   account information and confirm your order.

   Next, after account registration, order confirmation, payment,
   etc workflow steps have been complated at the very last view to
   display the Google Analytics Order Submission / Reciept View
   just before redirecting the user finaly at the end to the order
   view list.


Usage
==============================
To switch test mode off, open up googleanalytics.append.php
and switch "TestMode=enabled" to "TestMode=disabled".

Also make sure you have the proper settings in your
Google Analytics account control panel.

1. Order / Purchase Statistics Tracking for your shop commerce appliciations.

2. General Google Analytics Statistics via site settings

   Simply using 3.9 edit your site settings and add footer javascript code provided
   by google analytics control panel for general page view statistics. 

   Save site settings changes and review site html source output for confirmation 
   of successfull installation and configuration. You may also review google analytics 
   reports for your first collected statistics (There may be an inititial delay for 
   the display of recorded statistics).

2.5. General Google Analytics Statistics via template modifications

   Place this template code into your own pagelayout.tpl template.

   {include uri="design:google/analytics/stats.tpl"}

   Be certain to specify your Urchin account code in your settings configuration.

3. View the site to start submitting page view statistics to google analytics.


Troubleshooting
===============

1. Read the FAQ
   ------------

   Some problems are more common than others. The most common ones are listed
   in the the FAQ.

2. Support
   -------

   If you have find any problems not handled by this document or the FAQ you
   can contact Brookins Consulting trough the support system:

   http://brookinsconsulting.com/contact

