private function setData(Analytics $analytics, $webspaceKey, $data)
    {
        $analytics->setTitle($this->getValue($data, 'title'));
        $analytics->setType($this->getValue($data, 'type'));
        $analytics->setContent($this->getValue($data, 'content', ''));
        $analytics->setAllDomains($this->getValue($data, 'allDomains', false));
        $analytics->setWebspaceKey($webspaceKey);

        $analytics->clearDomains();

        if (!$analytics->isAllDomains()) {
            foreach ($this->getValue($data, 'domains', []) as $domain) {
                $domainEntity = $this->findOrCreateNewDomain($domain);
                $analytics->addDomain($domainEntity);
            }
        }
    }