Created
September 12, 2018 19:12
-
-
Save jonhilgart22/52ffa05c35eae1c7357e09d9a2f191fa to your computer and use it in GitHub Desktop.
This file contains 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 | |
a.subscription_created_at::date, | |
b.cleaned_source, | |
b.utm_campaign, | |
count(distinct b.browser_hash) as n_visits, | |
count(distinct case when w.first_user_created_event_at is not null then b.user_id else null end) as accounts_created, | |
count(distinct a.user_id) as credit_cards_added | |
from analytics.browser_hash_hits b | |
join analytics.acquisition_waterfall_by_browser_hash w | |
on w.browser_hash = b.browser_hash | |
left join analytics.acquisition_credit_card_source_tracking a | |
on a.user_id = b.user_id | |
and a.summarized_reporting_cleaned_source ilike '%google%' | |
where | |
b.cleaned_source ilike '%google%' | |
group by 1,2,3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment