Skip to content

Instantly share code, notes, and snippets.

"person": {
"full_name": "Ronald MacDonald"
"first_name": "Ronald",
"last_name": "MacDonald",
"email": "ronald@macdeez.co",
"title": "Sr. Manager, Burger Flippers",
"seniority_hierarchy": "Manager",
"department_group": "Kitchen",
"phone": "555-555-5555",
"country": "United States of America",
@nielsfogt
nielsfogt / Weekly Recurring Users Query (Segment Page Calls)
Last active June 30, 2019 20:22
This query shows you how to get your weekly recurring users (WRU) that have at least 10 pageviews in any given week and log in for 4 consecutive weeks.
/*
You'll need to update the following parts of the query:
* [segment_souce_name] - Check the SQL settings in Segment to see the schema name
* [addt'l filters] - If you have multiple web properties feeding into the same source, or maybe certain parts of the app you don't want included, you could add any other filters here using the various context attributes on the page calls.
* Another issue you might have is if you have multiple Segment sources representing different parts of your product.
If that's the case, you may need to do some sort of union of the pageview data in each weekly corhort, ex:
************
select
user_id