Skip to content

Instantly share code, notes, and snippets.

@jdwyah
Created April 26, 2016 19:02
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 jdwyah/f89968af747a251638bec8c245bfa547 to your computer and use it in GitHub Desktop.
Save jdwyah/f89968af747a251638bec8c245bfa547 to your computer and use it in GitHub Desktop.
SELECT
date_trunc('day', page.timestamp)
count(distinct page.anonymous_id),
count(distinct conversions.user_id)
FROM pages page
JOIN identifies ids
LEFT JOIN conversions ON conversions.user_id = identifies.user_id
WHERE
ids.anonymous_id = page.anonymous_id
AND completes.user_id = ids.user_id
AND page.name = 'landing-page'
GROUP BY 1,2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment