Skip to content

Instantly share code, notes, and snippets.

@steveburkett
Created August 23, 2011 21:44
Show Gist options
  • Save steveburkett/1166666 to your computer and use it in GitHub Desktop.
Save steveburkett/1166666 to your computer and use it in GitHub Desktop.
SQL queries for the retention report
Top 10 CPC keywords
===================
select client_id, store_id, keyword, visits from g5a_keywords where medium='cpc' group by client_id, store_id, keyword order by client_id, store_id, visits DESC;
Top 10 Organic Keywords
======================
select client_id, store_id, keyword, visits from g5a_keywords where medium='organic' group by client_id, store_id, keyword order by client_id, store_id, visits DESC;
Visits per month
====================
select SUM(visits), SUM(new_visits), SUBSTRING(day,6,2) from g5a_traffic_sources where client_id=1122 and store_id=4266 group by SUBSTRING(day,6,2) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment