webfactory/piwik-bundle — pull request #2 by mpdude (2014-10-31 11:06:47+00:00)
Title: Add support for additional tracker API calls

There are quite a few things and settings you can apply to the tracker; see http://developer.piwik.org/api-reference/tracking-javascript.

Of particular interest are user-defined variables. For example, you could push the category of the currently displayed blog post to Piwik to get categories-based analytics.

All those options basically end up as values/arrays in the _paq JavaScript variable.

Now it would be very handy if there was a service so you could write in your controller

```php
$this->get('piwik.tracker')->push(['trackGoal', 1, $cart->getValue()]);
```

or in Twig

```twig
{{ piwik_push(['setCustomVariable', 1, "gender", "male", "visit"]) }}
```

Then the bundle could collect all those extra settings and write them out once it renders the piwik_code.