| Commit | Line | Data |
|---|---|---|
| 97110728 | 1 | // $Id$ |
| 2 | ||
| 0efd556a | 3 | Module: Google Analytics |
| 3ae24718 | 4 | Author: Alexander Hass <http://drupal.org/user/85918> |
| 0efd556a MC |
5 | |
| 6 | ||
| 7 | Description | |
| 8 | =========== | |
| 9 | Adds the Google Analytics tracking system to your website. | |
| 10 | ||
| 11 | Requirements | |
| 12 | ============ | |
| 13 | ||
| 14 | * Google Analytics user account | |
| 15 | ||
| 16 | ||
| 17 | Installation | |
| 18 | ============ | |
| 19 | * Copy the 'googleanalytics' module directory in to your Drupal | |
| 037ccb3d | 20 | sites/all/modules directory as usual. |
| 0efd556a MC |
21 | |
| 22 | ||
| 23 | Usage | |
| 24 | ===== | |
| 037ccb3d | 25 | In the settings page enter your Google Analytics account number. |
| 5facbdc2 | 26 | |
| 0efd556a | 27 | All pages will now have the required JavaScript added to the |
| 5facbdc2 | 28 | HTML footer can confirm this by viewing the page source from |
| 0efd556a MC |
29 | your browser. |
| 30 | ||
| 037ccb3d | 31 | New approach to page tracking in 5.x-1.5 and 6.x-1.1 |
| 32 | ==================================================== | |
| 33 | With 5.x-1.5 and 6.x-1.1 there are new settings on the settings page at | |
| 097e118e | 34 | admin/config/system/googleanalytics. The "Page specific tracking" area now |
| 037ccb3d | 35 | comes with an interface that copies Drupal's block visibility settings. |
| 36 | ||
| 37 | The default is set to "Add to every page except the listed pages". By | |
| 38 | default the following pages are listed for exclusion: | |
| 39 | ||
| 97110728 | 40 | admin |
| 41 | admin/* | |
| 42 | user/*/* | |
| 43 | node/add* | |
| 037ccb3d | 44 | node/*/* |
| 45 | ||
| 46 | These defaults are changeable by the website administrator or any other | |
| 97110728 | 47 | user with 'administer google analytics' permission. |
| 037ccb3d | 48 | |
| 49 | Like the blocks visibility settings in Drupal core, there is now a | |
| 50 | choice for "Add if the following PHP code returns TRUE." Sample PHP snippets | |
| 51 | that can be used in this textarea can be found on the handbook page | |
| 52 | "Overview-approach to block visibility" at http://drupal.org/node/64135. | |
| 68c107f3 | 53 | |
| 26110623 | 54 | Custom variables |
| 55 | ================= | |
| 56 | One example for custom variables tracking is the "User roles" tracking. Enter | |
| 57 | the below configuration data into the custom variables settings form under | |
| 58 | admin/config/system/googleanalytics. | |
| 59 | ||
| 60 | Slot: 1 | |
| 61 | Name: User roles | |
| cbc14acc | 62 | Value: [current-user:role-names] |
| 26110623 | 63 | Scope: Visitor |
| 64 | ||
| 65 | More details about Custom variables can be found in the Google API documentation at | |
| 66 | http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html | |
| 67 | ||
| 68c107f3 | 68 | Advanced Settings |
| 69 | ================= | |
| 037ccb3d | 70 | You can include additional JavaScript snippets in the custom javascript |
| 71 | code textarea. These can be found on the official Google Analytics pages | |
| 72 | and a few examples at http://drupal.org/node/248699. Support is not | |
| 73 | provided for any customisations you include. | |
| 68c107f3 | 74 | |
| 97110728 | 75 | To speed up page loading you may also cache the Analytics ga.js |
| ffbad14e | 76 | file locally. |