Skip to content

Instantly share code, notes, and snippets.

@jonhilgart22
Created September 11, 2018 22:48
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 jonhilgart22/c1dfa4e153f610a3dfafd62262722c58 to your computer and use it in GitHub Desktop.
Save jonhilgart22/c1dfa4e153f610a3dfafd62262722c58 to your computer and use it in GitHub Desktop.
select
a.subscription_invitee_credit_minutes,
mm.messager_campaign_category,
mm.messager_campaign_name,
count(distinct a.user_id) as n_users
from analytics.acquisition_credit_card_source_tracking a
join analytics.messager_message_results mm
on mm.user_id = a.user_id
-- email sent before card added
and mm.messager_message_created_at < a.credit_card_added_user_event_at
where summarized_reporting_cleaned_source = 'invite_cold'
and credit_card_added_user_event_at >= getdate() - '7 days'::interval
and subscription_invitee_credit_minutes <= 30
--and messager_campaign_category = 'Invite'
group by 1,2,3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment