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