Skip to content

Instantly share code, notes, and snippets.

@ianks
Created April 21, 2020 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianks/c899971eb95de5bc8d93fa51b0908b25 to your computer and use it in GitHub Desktop.
Save ianks/c899971eb95de5bc8d93fa51b0908b25 to your computer and use it in GitHub Desktop.
Current Lead Source Analysis

Current Values

leadSource Count
"" 892
Direct 4939
Directory 1063
Friends and Family 1
Google Ad Words 2
Google PPC 7233
Organic Search 16338
Other 3162
Phone 3
Search 3
Social 552
source 17831
SOURCE 7
403
leadSourceDetail Count
" 8723
? 16
bing 912
direct 5591
facebook 552
FBofferNKM 1
Friends-Family:WinnResidential 1
gmb 1
GMB 614
GMBofferAPS2019 4
GMBofferPES2019 3
GMBofferSIS2019 1
gmbSNKM 1
google 20863
Google Natural 3
Google PPC 6
other 3193
Phone App 3
SOURCEDETAIL 9993
superpages 4
yahoo 468
yellowpages 8
yelp 1057
412

Queries to Generate

select 
  distinct(payload ->> 'leadSource') as leadSourc, 
  count(id) as Count 
from 
  store_inquiries 
where 
  contact_method = 'floorforce_inquiry' 
group by 
  payload ->> 'leadSource';
select 
  distinct(payload ->> 'leadSourceDetail') as leadSourceDetail, 
  count(id) as Count 
from 
  store_inquiries 
where 
  contact_method = 'floorforce_inquiry' 
group by 
  payload ->> 'leadSourceDetail';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment