Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Usage

Just by adding the filter and enabling the plugin in app.yml your site should begin tracking on your Google Analytics account. Beyond this, there are a few more pieces of functionality that allow you finer control over how your site interacts with Google Analytics.

Track a page as a custom URI

// from inside an action
null $this->setUrchinParam(string $utParam)

If any of your actions call any of the forward methods, the action that actually renders will likely not be the action referenced in the browser's address bar. This mixed-in method allows you to specify a URI to send up to Google Analytics once the page is loaded other that what is in the address bar.

For example, if you want to track how many visitors land on your error_404_action, you could call this:

// from inside an action
$this->setUrchinParam('/error/404?page='.$this->getModuleName().'/'.$this->getActionName());

These settings will place the tracking code just inside the response's opening <body> tag (in the prod environment). The plugin defaults to placing the tracking code just before the response's closing </body> tag.

Roadmap

Support for:

__utmLinker()

__utmLinkPost()

Changelog

Version 0.3.0-beta

Broke filter logic into protected methods for easy overloading.

Added insertion configuration.

Version 0.2.0-beta

Added support for SSL requests.

Added mixin methods to actions for easy modification of initialization variables and parameters.