Skip to content

Commit 13d9ecd

Browse files
committed
content + logic
1 parent 636a004 commit 13d9ecd

File tree

78 files changed

+3266
-805
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3266
-805
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
npm-debug.log*
1919
yarn-debug.log*
2020
yarn-error.log*
21+
22+
# Local Netlify folder
23+
.netlify

docs/censorship/censorship.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ author: 'John Gracey'
1616
public: True
1717
---
1818

19-
Censorship is a very important concept to understand. There are two methods to limiting what data Wisdom collects available to website owners. We recommend using HTML Configuration (the first method) as much as possible. You can also enable and disable certain Wisdom [recording modules](/censorship--recording-modules) like cookie tracking and mouse tracking.
19+
Censorship is a very important concept to understand. There are two methods to limiting what data Wisdom collects available to website owners. We recommend using HTML Configuration (the first method) as much as possible. You can also enable and disable certain Wisdom [recording modules](/censorship/recording-modules) like cookie tracking and mouse tracking.
2020

2121
<div class='spacer32'></div>
2222

@@ -65,7 +65,7 @@ Password visibility toggles may cause Wisdom to treat password fields as normall
6565
### 2. Tracking Configurations Page
6666
On the [Tracking Configuration](https://app.getwisdom.io/org/~/tracking) page you can specify CSS selectors to censor HTML elements, including input fields.
6767

68-
Beyond censoring HTML, you can also enable and disable certain Wisdom "recording modules", such as Mouse movement tracking. Please see the list of [recording modules](/censorship--recording-modules) for their impact on privacy.
68+
Beyond censoring HTML, you can also enable and disable certain Wisdom "recording modules", such as Mouse movement tracking. Please see the list of [recording modules](recording-modules) for their impact on privacy.
6969

7070

7171

docs/censorship/overview.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_label: Overview
55

66
### Censorship
77

8-
Censorship is a very important concept to understand. There are two methods to limiting what data Wisdom collects available to website owners. We recommend using HTML Configuration (the first method) as much as possible. You can also enable and disable certain Wisdom [recording modules](/js-client-api/recording-modules/README.md) like cookie tracking and mouse tracking.
8+
Censorship is a very important concept to understand. There are two methods to limiting what data Wisdom collects available to website owners. We recommend using HTML Configuration (the first method) as much as possible. You can also enable and disable certain Wisdom [recording modules](recording-modules) like cookie tracking and mouse tracking.
99

1010
<div class='spacer32'></div>
1111

@@ -53,7 +53,7 @@ Password visibility toggles may cause Wisdom to treat password fields as normall
5353
### 2. Tracking Configurations Page
5454
On the [Tracking Configuration](https://app.getwisdom.io/org/~/tracking) page you can specify CSS selectors to censor HTML elements, including input fields.
5555

56-
Beyond censoring HTML, you can also enable and disable certain Wisdom "recording modules", such as Mouse movement tracking. Please see the list of [recording modules](js-client-api/recording-modules/README.md) for their impact on privacy.
56+
Beyond censoring HTML, you can also enable and disable certain Wisdom "recording modules", such as Mouse movement tracking. Please see the list of [recording modules](recording-modules) for their impact on privacy.
5757

5858

5959

docs/data-access/cube-js.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import TabItem from '@theme/TabItem';
99
import Code from '../../src/common/code/'
1010

1111

12+
## Intro
13+
1214
<Image img={require('./cubejs.png')} className='noShadow'/>
1315

1416
[Visit Cubejs](https://cube.dev/)
@@ -17,20 +19,21 @@ import Code from '../../src/common/code/'
1719
Cubejs is an open source analytics framework that greatly simplifies running analytics queries. Cubejs comprises of a frontend library and backend analytical server infrastructure that Wisdom fully manages for you. Like many modern analytics frameworks, Cubejs differentiates between data dimensions (time, browser) and data measures (user count, unique page views).
1820

1921

20-
### Cubes
21-
22-
atomic.person
23-
atomic.session
24-
atomic.events
25-
atomic.mail_inbox
26-
27-
virtual.pageviews
28-
22+
## Cubes
2923

30-
rollup
24+
| Cube Name | Cube Description |
25+
|---|---|
26+
| atomic.person | |
27+
| atomic.session | |
28+
| atomic.events | |
29+
| atomic.mail_inbox | |
30+
| | |
31+
| virtual.pageviews | |
32+
| | |
33+
| rollup | |
3134

3235

33-
### Example Code
36+
## Example Code
3437

3538

3639
<Tabs

docs/data-access/management.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,30 @@ sidebar_label: Lifecycle Management:preview
55

66

77

8-
hello world
8+
### Data Retention
9+
10+
Wisdom utilizes pass-through (cost plus) pricing ontop of AWS infrastructure allowing our customers to fine-tune their storage requirements- and in many cases receive substantial cost savings.
11+
12+
1. Duration: Increase Data Retention from zero days to an indefinitely timeline (billing per gigabyte/hour).
13+
2. Durability: Reducing data replication factor to cut cost by ~20%, reducing data availability and data safety in the case of data center destruction.
14+
15+
16+
| Type | Description |
17+
|---------------------------------------|----------------------------------|
18+
| S3 Objects: Recorded Sessions | |
19+
| S3 Objects: (everything else) | |
20+
| SQL Tables: <br/> - atomic.sessions <br/> - atomic.events table| |
21+
| SQL Tables: (everything else) | |
22+
23+
24+
### Data Durability
25+
26+
| Type | Description |
27+
|----------------------|---------------|
28+
| S3 Recorded Sessions | Configurable |
29+
| PSQL | Configurable |
30+
31+
32+
## Data Deprecation
33+
34+
Transfering out old SQL data to S3 on a weekly basis for data continuity multiple years out.

docs/data-access/overview.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
---
2-
title: Overview
2+
title: Data Access Overview
33
sidebar_label: Overview
44
---
5+
6+
7+
8+
9+
Wisdom is your modern web analytics data lake, home to an exciting community of SaaS product builders who share and contribute custom reports. This is what makes Wisdom such a compelling solution- that Wisdom allows customers to directly access and query their SQL data from their own provisioned PostgreSQL database, and their own AWS S3 bucket.
10+
11+
Here we discuss how to access and manage this data.
12+
13+
| Section |
14+
|-----------------------------|
15+
| [Data Lifecycle Management](/data-access/management) |
16+
| [Object Storage (AWS S3)](/data-access/blob) |
17+
| [SQL Tables Schemas](/data-access/sql-tables/overview) |
18+
| [HTTP REST API: Overview](/data-access/api/overview) |
19+
| [Ecosystem Overview](/ecosystem/overview) |

docs/data-access/sql-reports/@wisdom_developing_all-together.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ sidebar_label: '@wisdom/developing/all-together'
77
## Example Usage
88

99
```sql
10-
SELECT * FROM community.report(NULL::"@wisdom/developing/all-together",
11-
_project_id = ?
10+
SELECT * FROM community.report(NULL::community_types."@wisdom/developing/all-together",
11+
_project_id => ?
1212
);
1313
```
1414

docs/data-access/sql-reports/@wisdom_developing_building-on-other-queries.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_label: '@wisdom/developing/building-on-other-queries'
77
## Example Usage
88

99
```sql
10-
SELECT * FROM community.report(NULL::"@wisdom/developing/building-on-other-queries");
10+
SELECT * FROM community.report(NULL::community_types."@wisdom/developing/building-on-other-queries");
1111
```
1212

1313

docs/data-access/sql-reports/@wisdom_developing_hello-world.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar_label: '@wisdom/developing/hello-world'
77
## Example Usage
88

99
```sql
10-
SELECT * FROM community.report(NULL::"@wisdom/developing/hello-world");
10+
SELECT * FROM community.report(NULL::community_types."@wisdom/developing/hello-world");
1111
```
1212

1313

docs/data-access/sql-reports/@wisdom_developing_passing-parameters.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ sidebar_label: '@wisdom/developing/passing-parameters'
77
## Example Usage
88

99
```sql
10-
SELECT * FROM community.report(NULL::"@wisdom/developing/passing-parameters",
11-
_project_id = ?
10+
SELECT * FROM community.report(NULL::community_types."@wisdom/developing/passing-parameters",
11+
_project_id => ?
1212
);
1313
```
1414

docs/data-access/sql-reports/overview.md

+25-66
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ title: Community SQL Reports Overview
33
sidebar_label: Overview
44
---
55

6-
## Running Community Queries
6+
## About
77

8-
A Few Sample Queries to get you started.
8+
Like most things in life, someone's already thought of it, and very likely already done it. Just try registering a `.com` domain name or registering a username on Reddit. With Relational Databases being around since the 1970s thanks to IBM's Edgar Codd, analytics and reporting ideas have been around for over 50 years. Building on this body of knowledge, we've put together a SQL library built by the Wisdom community to easily share analytics reports- collaboration taking place from [Github](https://github.com/Wisdom/community-sql).
99

10+
<br/>
1011

12+
Getting started is easy:
13+
14+
```sql
15+
-- 1. Update the Library stored in your PostgreSQL database:
16+
SELECT community.update_reports();
17+
18+
-- 2. Pick a query from the library and run it.
19+
SELECT * FROM community.report(NULL::community_types."@wisdom/developing/hello-world");
20+
```
1121

12-
### A Safe, Simple and Collaborative system.
13-
From an open community, reports are created
1422

23+
### How it Works
24+
When the `community.report()` function is run, the SQL code of the desired report is looked-up within the `community.queries` table- and this table is updated with the `community.update_reports()` function that pulls in queries from the [Github Repo](https://github.com/Wisdom/community-sql). On Github, SQL reports are defined with two files: 1) the SQL code stored in `query.sql`, 2) Metadata stored in a `manifest.json` file. Within the manifest file all mandatory SQL query parameters are defined.
1525

16-
- Only Variable literal values (single quote vars). Passing idents are not supported (double quote variables).
17-
- Function is executed as current user?????
18-
- During a `report_update` function call, all views within the `community_types` schema will be deleted, cascading to all dependents, and then replaced. Therefore, if you are building queries ontop of community queries, they too should be created as a community query to ensure they are always updated and not deleted.
19-
- Undercovers, PLPSQL uses `EXECUTE` from a `format()`. Var markers are only injected if they are non-null.
26+
You may note the strange syntax when running a community query (eg. `null::community_types."@example/test"). PostgreSQL's procedural language ("PL/pgSQL") has a strongly-typed type system that requires all queries have a predefined return type. This strange syntax converts null to the proper return type of the SQL query, ultimately defined within the manifest.json file.
2027

21-
SQL:
22-
format('SELECT $$_session_id$$ LIMIT 5;',
23-
REPLACE(__sql, '$$_session_id$$', _session_id)
2428

2529

2630
A Few Example Queries to get you started developing
@@ -31,55 +35,6 @@ A Few Example Queries to get you started developing
3135

3236
| Report Query Path | Title | Requires Params |
3337
|----------------------------------------------------|---------------------------|-----------------|
34-
| [@wisdom/developing/all-together](./@wisdom/developing/all-together) | HelloworldQuery ||
35-
| [@wisdom/developing/building-on-other-queries](./@wisdom/developing/building-on-other-queries) | HelloworldQuery ||
36-
| [@wisdom/developing/hello-world](./@wisdom/developing/hello-world) | HelloWorldQuery ||
37-
| [@wisdom/developing/passing-parameters](./@wisdom/developing/passing-parameters) | HelloworldQuery ||
38-
39-
40-
41-
42-
43-
CORE:
44-
- list all pages.
45-
- get users with first + last visit time + activity trend???
46-
47-
@wisdom/components/page-engagement`
48-
49-
50-
PERIOD_SUM
51-
PERIOD TREND:
52-
Activity Time (avg, median, stddev)
53-
Page Views
54-
Proportional
55-
56-
Questions To ask:
57-
- Do users know this feature exists.
58-
-- Have they visited, AND interacted on it?
59-
- Do users like this feature?
60-
--
61-
62-
63-
-- When do users interact with features? 1. Time to Activation overlayed with 2. Median activity time per user
64-
(cohort by calendar date (days), or activeTime sum (15 mins))
65-
66-
FEATURE SUCCESS:
67-
- number of users as percent of app total? (shift delay days???)
68-
- median activity time.
69-
-
70-
71-
Page Engagement
72-
Page Engagement by Person:
73-
TREND
74-
75-
Histogram cohorted?
76-
77-
78-
79-
80-
The query will not be executed if two dollar signs exist in the query: `$$`, indicating that a param has not been substituted.
81-
82-
8338

8439

8540

@@ -114,16 +69,20 @@ A few example community queries to help you get started developing SQL reports.
11469
## Semantic Requirements And Conventions
11570

11671
When namimg files and folders, keep in mind:
117-
- Root directory folders must start with '@', as Github name handle.
118-
- Files and folders must be lowercased, and only allow a-z, 0-9 and dash.
72+
- Root directory folders must start with '@', as your own Github name handle- so everyone knows who the author/owner is.
73+
- Files and folders must be lowercased, and only allow the following characters: a-z, 0-9 and dash.
11974
- Three files are required per report: query.sql, manifest.json, and README.md.
75+
- To contribute, submit a pull request and accept the MIT contributor license assignment.
12076

12177

122-
### Strict Type Checking
123-
-- views created from JSON type
12478

79+
### A Safe, Simple and Collaborative system.
80+
From an open community, reports are created
12581

12682

83+
- Only literal value variables (single quote variables) are possible. Passing idents are not supported (double quote variables).
84+
- The community report is executed as the current user, with all permissions they have.
85+
- During a `community.report_update` function call, all views within the `community_types` schema will be deleted, cascading to all dependents, and then replaced. Therefore, if you are building queries ontop of community queries, they too should be created as a community query to ensure they are always updated and not deleted.
86+
- Undercovers, PLPSQL uses `EXECUTE` from a `format()`. Variables are only injected if they are non-null.
87+
- You can access variables from the $1 JSONB parameter with type casting: `($1->>'_project_id')::INTEGER`
12788

128-
PR Process:
129-
- must accept contributor license MIT contributor guide as part of a PR checklist

docs/data-access/sql-tables/atomic.session.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Column | Type | Nullable | Default | Storage |
7676
`"wisdomVersion"` | character varying(20) | | | extended |
7777
`"pageCreatedAt"` | timestamp with time zone | | | plain |
7878
`"softDeletedAt"` | timestamp with time zone | | | plain |
79+
s3Bytes | integer | | | plain |
7980
### Indexes:
8081
```
8182
"Session_pkey" PRIMARY KEY, btree ("projectId", "sessionStart", "sessionId")

docs/data-access/sql-tables/overview.md

+13-18
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ select nspname from pg_catalog.pg_namespace;
8686

8787
| Schemas |
8888
|--------------------------------|
89-
| atomic |
90-
| rollup |
91-
| team |
92-
| enrichment |
93-
| trained |
89+
| admin |
9490
| alpha |
95-
| beta |
96-
| normalized_vendor |
9791
| app |
98-
| sandbox |
99-
| admin |
92+
| atomic |
93+
| beta |
10094
| community |
10195
| community_types |
96+
| enrichment |
97+
| normalized_vendor |
98+
| rollup |
99+
| sandbox |
100+
| team |
101+
| trained |
102102

103103

104104

@@ -107,17 +107,12 @@ select nspname from pg_catalog.pg_namespace;
107107

108108
| Tables with Schema |
109109
|--------------------------------|
110-
| [alpha.aggregate_mouse_position](./alpha.aggregate_mouse_position.md) |
111-
| [alpha.aggregate_scroll_abandonment](./alpha.aggregate_scroll_abandonment.md) |
112-
| [alpha.aggregate_scroll_position](./alpha.aggregate_scroll_position.md) |
113-
| [alpha.url_category](./alpha.url_category.md) |
114110
| [atomic.company](./atomic.company.md) |
115111
| [atomic.employee](./atomic.employee.md) |
116112
| [atomic.event](./atomic.event.md) |
117113
| [atomic.mail_inbox](./atomic.mail_inbox.md) |
118114
| [atomic.person](./atomic.person.md) |
119115
| [atomic.session](./atomic.session.md) |
120-
| [community.queries](./community.queries.md) |
121116
| [enrichment.domain_rank](./enrichment.domain_rank.md) |
122117
| [enrichment.person_enrichment](./enrichment.person_enrichment.md) |
123118
| [enrichment.spam_email_service](./enrichment.spam_email_service.md) |
@@ -135,7 +130,7 @@ select nspname from pg_catalog.pg_namespace;
135130

136131

137132
### Data Syncing SaaS Vendors
138-
Note: Requires setup of vendor secret API keys (auth tokens). Since this functionality is realtively speaking new, you should reach out to your assigned Wisdom account manager to discuess getting started with normalized vendor data.
133+
Note: Requires setup of vendor secret API keys (auth tokens). Since this functionality is relatively new, you should reach out to your assigned Wisdom account manager to discuss getting started with normalized vendor data.
139134

140135
| Category | Vendor Name | SQL Schema
141136
|----------|---------------------|----------------------------
@@ -164,7 +159,7 @@ Note: Requires setup of vendor secret API keys (auth tokens). Since this functio
164159

165160

166161

167-
### Reserved for administrative and future use
162+
### Tables Reserved for Administrative and for Future Use
168163

169164
Schema | Name | Note |
170165
------------|----------------------------------|------|
@@ -183,11 +178,11 @@ Note: Requires setup of vendor secret API keys (auth tokens). Since this functio
183178

184179
#### Triggers
185180

186-
1. On record insert into table `person`, a trigger will broadcast a notification identified as `project_${projectId}`. This will help you implement real-time data processing within your application, for example, new user signup notifications.
181+
On record insert into table `person`, a trigger will broadcast a notification identified as `project_${projectId}`. This will help you implement real-time data processing within your application, for example, new user signup notifications.
187182

188183
#### Functions
189184

190-
2. NOTE: See [Community Reports](#) for how to use and run community report functions.
185+
NOTE: See [Community Reports](#) for how to use and run community report functions.
191186
- `community.report();`
192187
- `community.update_reports();`
193188

0 commit comments

Comments
 (0)