Created
February 7, 2017 14:29
-
-
Save atadams/45504a8b115efbfe74349aa3f79a90cd to your computer and use it in GitHub Desktop.
Piwik Referer Domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(referer_url, '://', -1), '/', 1), 'www.', -1) AS domain, | |
count(*) AS visits | |
FROM piwik_log_visit | |
WHERE | |
visit_first_action_time BETWEEN '2017-01-01' AND '2017-02-01' | |
AND referer_url NOT LIKE '%effectivehealthcare.ahrq.go%' | |
GROUP BY domain | |
ORDER BY visits DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment