Google Analytics - Documentation

Installation

Copy pi.google_analytics.php to your system/plugins folder.

Usage

{exp:google_analytics id="UA-9999999-1"} or simply {exp:google_analytics} (if the id is set in config.php)

Parameters

id="UA-9999999-1"

The Google Analytics ID for your site* * If the following setting is added to the config.php file, the id parameter is not needed and is ignored in the template:

$conf['google_analytics_id'] = "UA-9999999-1";
code="urchin"

If set to "urchin", the old Google Analytics urchin code will be loaded. If set to "ga" or "normal", or if the parameter is absent, the standard Google Analytics code will be loaded.

search_tracking="off"

If set to "on" or if the parameter is absent, the plugin will track site search queries on search result pages, i.e. search result pages where the last segment is the EE search id. Set to anything else to turn off.

search_query_parameter="/search/results?query="

Sets the search Query parameter set in Google Analytics. If the parameter is absent and search tracking is on, default is "/search?q=".

Tracking mailto/file download/outbound links

{exp:google_analytics:track link="/downloads/file.zip"}

Use the tag in hyperlinks: <a href="/downloads/file.zip" onclick="{exp:google_analytics:track link="/downloads/file.zip"}">File</a>

Parameters

link="/downloads/file.zip"

The mailto/file/outbound link to track.

Creative Commons License