public function track($refererUrl, $pageUrl)
    {
        $firstParsed = $this->getRefererParser()->parseUrl($refererUrl);

        if ($firstParsed) {
            $attributes = [
                'url'               => $firstParsed['url'],
                'host'              => $firstParsed['host'],
                'domain_id'         => $this->trackDomain($firstParsed['domain']),
                'medium'            => null,
                'source'            => null,
                'search_terms_hash' => null,
            ];

            $secondParsed = $this->getRefererParser()->parse($firstParsed['url'], $pageUrl);

            if ($secondParsed->isKnown()) {
                $attributes['medium']            = $secondParsed->getMedium();
                $attributes['source']            = $secondParsed->getSource();
                $attributes['search_terms_hash'] = sha1($secondParsed->getSearchTerm());
            }

            /** @var  \Arcanedev\LaravelTracker\Models\Referer  $referer */
            $referer = $this->getModel()->newQuery()->firstOrCreate(
                Arr::only($attributes, ['url', 'search_terms_hash']),
                $attributes
            );

            if ($secondParsed->isKnown()) {
                $this->trackRefererSearchTerms($referer, $secondParsed->getSearchTerm());
            }

            return $referer->id;
        }

        return null;
    }