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.

2. Configure

You'll have to copy the profile_id value out of the tracking code Google supplies for your site profile. This value typically starts with the letter U and ends with a single digit.

This plugin defaults to using the older urchin tracker. To take advantage of the latest featureset of Google Analytics, change the tracker value to google. This will insert the new ga.js tracking code into your project.

Advanced Usage

This plugin provides much more functionality than a simple insert of your tracking code. Here are some highlights:

How do I customize the name a page is tracked as?

If you would like to track a certain page as something other than what appears in the browser address bar, you can do so by modifying the page_name parameter in module.yml:

In this example, the request after the successful form post will be tracked as /contact/success.

Option: is_route

One more option available is the is_route option. When this flag is applied, the string provided for a page name will be passed through sfRouting before being added to the page. Using this option allows you to centralize all URLs, those real and for tracking purposes only, in your application's routing.yml file:

Can I insert the tracking code at the top of my page?

Can I track demographic information?

You can expose whatever information you store on your users (that your privacy policy allows, of course) to Google Analytics. This is best done in your sign-in routine. For example, if you're using sfGuardPlugin: