public function getPiwik($wrap = true)
    {
        if (Director::isDev() && !Config::inst()->get(PiwikExtension::class, 'show_on_dev')) {
            return false;
        }
        if (Director::isTest() && !Config::inst()->get(PiwikExtension::class, 'show_on_test')) {
            return false;
        }
        if (Director::isLive() && !Config::inst()->get(PiwikExtension::class, 'show_on_live')) {
            return false;
        }

        //used for overwriting defaults in SiteConfig, e.g. for different SiteIDs in a Subsite installation
        $currentSiteConfig = Controller::curr()->hasMethod('getSiteConfig')
            ? Controller::curr()->getSiteConfig()
            : SiteConfig::current_site_config();


        $data = [
            'WrapInJsTags' => $wrap,
            'URL' => Config::inst()->get(PiwikExtension::class, 'piwik_server'),
            'SiteID' => Config::inst()->get(PiwikExtension::class, 'piwik_site_id'),
            'SiteConfig' => $currentSiteConfig
        ];

        return ArrayData::create($data)->renderWith(['Netwerkstatt\\Piwik\\Piwik']);
    }