.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ======================== EXT: RS Google Analytics ======================== :Author: Christopher :Created: 2010-12-18T19:57:23 :Changed: 2012-12-10T13:23:38 :Classification: rsgoogleanalytics :Keywords: forAdmins, forIntermediates :Author: Steffen Ritter, François Suter :Email: info@rs-websystems.de, typo3@cobweb.ch :Language: en .. _img-1-img-2-EXT-RS-Google-Analytics: |img-1| |img-2| EXT: RS Google Analytics ======================================== Extension Key: rsgoogleanalytics Language: en Version: 3.1.0 Keywords: forAdmins, forIntermediates Copyright 2006-2012, Steffen Ritter , François Suter This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- **`EXT: RS Google Analytics 1 <#__RefHeading__5708_1738894311>`_** **`Introduction 3 <#__RefHeading__5710_1738894311>`_** `What does it do? 3 <#__RefHeading__463_413120346>`_ **`Installation 4 <#__RefHeading__467_413120346>`_** `Base setup 4 <#__RefHeading__2178_745043424>`_ `Upgrading to version 3.0 4 <#__RefHeading__2180_745043424>`_ **`Configuration 5 <#__RefHeading__31515_818911409>`_** `Constants 5 <#__RefHeading__4309_745043424>`_ `Setup 5 <#__RefHeading__31519_818911409>`_ **`Developer's Guide 7 <#__RefHeading__31525_818911409>`_** `E-Commerce tracking API 7 <#__RefHeading__642_2108705915>`_ `Hooks 7 <#__RefHeading__730_1536355570>`_ **`Known problems 8 <#__RefHeading__644_2108705915>`_** **`To-Do list 9 <#__RefHeading__477_413120346>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ This extension simplifies the installation and usage of Google Analytics tracking code. It can use either the traditional or the asynchronous method and enables most of the options provided by the Google Analytics API. The main code itself is inserted via a customizable template. .. _Installation: Installation ------------ .. _Base-setup: Base setup ^^^^^^^^^^ Install the extension and include the appropriate static TypoScript. There are four different files: |img-3| - Legacy Setup: this is just for backwards-compatibility reasons, don't use it on a new system. - General Setup: this file contains all the configuration options for the extensions. - Traditional Method: this file contains the code to include the necessary JavaScript using the traditional method. - Asynchronous Method: this file contains the code to include the necessary JavaScript using the asynchronous method. .. _Notes: Notes """"" - The two "Method" files assume that your main page object is called "PAGE". If this is not the case, don't use these files. Copy their content to your own template and change the name to the one that you are using. - Including the "Asynchronous Method" is not enough, the relevant TypoScript properties must be changed too, i.e. the "asynchronous" and "templateFile" properties (see "Configuration" chapter). .. _Upgrading-to-version-3-0: Upgrading to version 3.0 ^^^^^^^^^^^^^^^^^^^^^^^^ Everything was done to ensure backwards-compatibility, so upgrading should not break anything. However to benefit from the new features – in particular the use of the asynchronous method for calling up Google Analytics – you will need to change the static TypoScript files used. Refer to the preceding paragraph and to the "Configuration" chapter. .. _Configuration: Configuration ------------- There exists a number of TypoScript properties that can be used to configure this extension. They are listed below. .. _Constants: Constants ^^^^^^^^^ .. ### BEGIN~OF~TABLE ### .. _active: active """""" .. container:: table-row Property active Data type boolean Description Whether plugin is active or not Default 1 .. _asynchronous: asynchronous """""""""""" .. container:: table-row Property asynchronous Data type boolean Description Whether traditional or asynchronous method should be used (set to 1 for asynchronous). Beware to be consistent with template file Default 1 .. _account: account """"""" .. container:: table-row Property account Data type string Description Your Google-Analytics account number. Default is a test account of RS WebSystems Default UA-1628673-4 .. _templateFile: templateFile """""""""""" .. container:: table-row Property templateFile Data type file Description File containing the JavaScript code template Default EXT:rsgoogleanalytics/res/templates/codeAsynchronous.js .. ###### END~OF~TABLE ###### .. _Setup: Setup ^^^^^ .. ### BEGIN~OF~TABLE ### .. _templateFile: templateFile """""""""""" .. container:: table-row Property templateFile Data type resource Description File containing the JavaScript code template Default {$plugin.tx\_rsgoogleanalytics.templateFile} .. _asynchronous: asynchronous """""""""""" .. container:: table-row Property asynchronous Data type boolean Description Whether traditional or asynchronous method should be used (set to 1 for asynchronous). Beware to be consistent with template file Default {$plugin.tx\_rsgoogleanalytics.asynchronous} .. _active: active """""" .. container:: table-row Property active Data type boolean Description Whether plugin is active or not Default {$plugin.tx\_rsgoogleanalytics.active} .. _account: account """"""" .. container:: table-row Property account Data type string Description Your Google Analytics account number. Default is a test account of RS WebSystems Default {$plugin.tx\_rsgoogleanalytics.account} .. _registerTitle: registerTitle """"""""""""" .. container:: table-row Property registerTitle Data type string Description Which kind of page title should be tracked. If empty, Google Analytics will use the path part of the URL. **Options** - **title** : Page title is used - **rootline** : Rootline of page titles is used Default rootline .. _trackDownloads: trackDownloads """""""""""""" .. container:: table-row Property trackDownloads Data type string Description Should downloads be tracked by GA. Set value to **!ALL** , to track all downloads regardless of other options (see below). Default 1 .. _trackDownloads-folderList: trackDownloads.folderList """"""""""""""""""""""""" .. container:: table-row Property trackDownloads.folderList Data type string Description Folders from which downloads should be tracked only (comma-separated list) Default fileadmin/,uploads/ .. _trackDownloads-fileTypes: trackDownloads.fileTypes """""""""""""""""""""""" .. container:: table-row Property trackDownloads.fileTypes Data type string Description Restrict download tracking to specific file types (comma-separated list). Default pdf,doc .. _trackExternals: trackExternals """""""""""""" .. container:: table-row Property trackExternals Data type string Description Track external links. Set value to **!ALL** to track all external URLs regardless of other options (see below) Default 1 .. _trackExternals-domainList: trackExternals.domainList """"""""""""""""""""""""" .. container:: table-row Property trackExternals.domainList Data type string Description Restrict tracking of external links to to these domains (comma- separated list) Default amazon.com,typo3.org .. _multipleDomains: multipleDomains """"""""""""""" .. container:: table-row Property multipleDomains Data type boolean Description Set to 1 if you have multiple domains enabled for this site Default 0 .. _multipleDomains-domainNames: multipleDomains.domainNames """"""""""""""""""""""""""" .. container:: table-row Property multipleDomains.domainNames Data type string Description Comma-separated list of domains Default .. _trackSubDomains: trackSubDomains """"""""""""""" .. container:: table-row Property trackSubDomains Data type boolean Description Enable tracking for a specific domain (will not work if "multipleDomains" is enabled Default 0 .. _trackSubDomains-domainName: trackSubDomains.domainName """""""""""""""""""""""""" .. container:: table-row Property trackSubDomains.domainName Data type string Description Domain to track Default example.com .. _searchEngines-redirectKeywords: searchEngines.redirectKeywords """""""""""""""""""""""""""""" .. container:: table-row Property searchEngines.redirectKeywords Data type string Description Comma-separated list of keywords to consider as direct access Default my name, my domain, city and company name .. _searchEngines-redirectReferrer: searchEngines.redirectReferrer """""""""""""""""""""""""""""" .. container:: table-row Property searchEngines.redirectReferrer Data type string Description Comma-separated list of referrers to consider as direct access Default example.net,domain2-redirected.de,my-web-agency.de .. _customVars: customVars """""""""" .. container:: table-row Property customVars Data type array Description Custom variables to send along with the tracking information. Each array item has stdWrap properties. Default 1 { name = gender scope = 1 data = TSFE:fe\_user\|user\|gender } 2 { name = name scope = 1 data = TSFE:fe\_user\|user\|name } .. _visitorSegment: visitorSegment """""""""""""" .. container:: table-row Property visitorSegment Data type stdWrap Description Name of the visitor, passed along with the tracking information. Default data = TSFE:fe\_user\|user\|name .. _eCommerce-enableTracking: eCommerce.enableTracking """""""""""""""""""""""" .. container:: table-row Property eCommerce.enableTracking Data type boolean Description Enable tracking of e-commerce transactions Default true .. _disableDataTracking-browserInfo: disableDataTracking.browserInfo """"""""""""""""""""""""""""""" .. container:: table-row Property disableDataTracking.browserInfo Data type boolean Description Disables logging of browser information. Default 0 .. _browsdisableDataTracking-flashTest: browsdisableDataTracking.flashTest """""""""""""""""""""""""""""""""" .. container:: table-row Property browsdisableDataTracking.flashTest Data type boolean Description Disables detection of Flash installation and version. Default 0 .. _BrowsdisableDataTracking-pageTitle: BrowsdisableDataTracking.pageTitle """""""""""""""""""""""""""""""""" .. container:: table-row Property BrowsdisableDataTracking.pageTitle Data type boolean Description Disables storage of page title. Default 0 .. _disableDataTracking-anonymizeIp: disableDataTracking.anonymizeIp """"""""""""""""""""""""""""""" .. container:: table-row Property disableDataTracking.anonymizeIp Data type boolean Description Anonymizes IP address (required by German law, for example) Default 1 .. ###### END~OF~TABLE ###### [tsref:plugin.tx\_rsgoogleanalytics] .. _Developer-s-Guide: Developer's Guide ----------------- .. _E-Commerce-tracking-API: E-Commerce tracking API ^^^^^^^^^^^^^^^^^^^^^^^ Developers of e-Commerce extensions can use this extension's API to hand over information regarding a purchase to be tracked by Google Analytics. According to the ruleset of Google Analytics you may track the following pieces of information: - Total order - Information about each basket Item. If you want to track information about each basket item, the total order information is a pre-requisite and must match the sum of the basket items. .. _generated: ((generated)) """"""""""""" .. _Example: Example ~~~~~~~ :: if (t3lib_extMgm::isLoaded('rsgoogleanalytics')) { /** @var tx_rsgoogleanalytics $GA */ $GA = t3lib_div::makeInstance('tx_rsgoogleanalytics'); $GA->addCommerceTransaction($order->getId(), 'OnlineShop', $order->getTotalGross(), $order->getTaxAmountHigh() + $order->getTaxAmountLow(),0, $order->getBillAddress()->getCity(), '', 'DE'); /** @var Tx_*_Domain_Model_OrderPosition $position */ foreach ($order->getPositions() AS $position) { $GA->addCommerceItem($order->getId(), $position->getArticle()->getSku(), $position->getArticle()->getTitle(), $position->getArticle()->getProduct()->getSeries()->getTitle(), } } The addCommerceTransaction()method expects eight parameters, related to the order, namely: - the **id** of the order - a **name** identifying the store where the order was placed - the **total** amount of the order - the amount of **taxes** and **shipping** - the **city** , **state** and **country** of destination The addCommerceItem()method expects six parameters, related to each item in the shopping basket: - the **id** of the order - the **id** (sku) of the item - the **name** of the item - the **category** it belongs to - the **price** - the ordered **quantity** .. _Hooks: Hooks ^^^^^ The extension provides the following hook: **processPageName:** this hook makes it possible to manipulate the page name for special needs. It receives as arguments the page name calculated so far (if at all) and a back-reference to thetx\_rsgoogleanalyticsobject. It **must** return the page name, even if unchanged. .. _Known-problems: Known problems -------------- None to date. Please report problems by opening a bug report at http://forge.typo3.org/projects/extension-rsgoogleanalytics/issues. .. _To-Do-list: To-Do list ---------- Check the roadmap on the project's page on Forge: http://forge.typo3.org/projects/extension-rsgoogleanalytics/roadmap For feature request, please open a report at http://forge.typo3.org/projects/extension-rsgoogleanalytics/issues .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 44 .. :id: graphics5 .. :name: graphics5 .. :vspace: 57 .. :width: 161 .. |img-2| image:: img-2.png .. :align: left .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 181 .. :id: graphics1 .. :name: graphics1 .. :vspace: 8 .. :width: 574