webfactory / piwik-bundle

Symfony Bundle with twig-function for the Matomo (fka Piwik) tracking code
MIT License
39 stars 16 forks source link

Support of multiple trackers #8

Open kachkaev opened 9 years ago

kachkaev commented 9 years ago

I've seen a few cases when people were willing to use multiple trackers in their apps. It would be nice if your repository could support them too in a way. The config would look like this:

webfactory_piwik:
    main:
        site_id: 1
        disabled: %kernel.debug%
        piwik_host: my.piwik.hostname
       tracker_path: "/js/"
    other:
        site_id: 42
        disabled: %kernel.debug%
        piwik_host: example.com
        tracker_path: "/analytics/"

If this ever gets implemented, service names in #7 would have to be made different too:

$tracker1 = $container->get('webfactory_piwik.tracker.main');
$tracker2 = $container->get('webfactory_piwik.tracker.other');
mpdude commented 9 years ago

We should do this in a BC way and we need to allow choosing a tracker in the Twig function as well.