Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Heatmaps instrumentation #1131

Merged
merged 43 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f898d51
Refactoring of autocapture things
benjackwhite Apr 10, 2024
a7f44a5
Fixes
benjackwhite Apr 10, 2024
fcc41fd
Fixes
benjackwhite Apr 10, 2024
0ac0175
Fixed up imports
benjackwhite Apr 10, 2024
ec77ae1
Fixes
benjackwhite Apr 10, 2024
5637e27
Fixe
benjackwhite Apr 10, 2024
bdc80ec
Merge branch 'main' into feat/heatmaps
benjackwhite Apr 10, 2024
65f5344
Fixes
benjackwhite Apr 10, 2024
c31de30
Remove "enable_collect_everything"
benjackwhite Apr 10, 2024
d601ad8
Fixes
benjackwhite Apr 10, 2024
ee50931
fix
benjackwhite Apr 10, 2024
315026c
Fix tests
benjackwhite Apr 10, 2024
88e5875
Fixes
benjackwhite Apr 10, 2024
82f7ffc
Fixed up
benjackwhite Apr 10, 2024
e52eca5
Added try catch
benjackwhite Apr 10, 2024
4c3ae34
Fixes
benjackwhite Apr 10, 2024
4ffac3c
fix
benjackwhite Apr 10, 2024
71ab606
Fix
benjackwhite Apr 10, 2024
1752b65
Fix
benjackwhite Apr 10, 2024
74e31a2
Fix?
benjackwhite Apr 10, 2024
2f2ba57
Fix?
benjackwhite Apr 10, 2024
7b9dbec
fix
benjackwhite Apr 10, 2024
140010c
Added heatmaps tracking preview code
benjackwhite Apr 10, 2024
3f76d9c
Fixes
benjackwhite Apr 10, 2024
817074f
Fix test
benjackwhite Apr 10, 2024
6af76f4
Change name
benjackwhite Apr 11, 2024
97ad2b5
chore: Pageview refactor (#1132)
benjackwhite Apr 11, 2024
ae795c2
Fixes
benjackwhite Apr 11, 2024
db050c4
Fix
benjackwhite Apr 11, 2024
08d0503
Fix
benjackwhite Apr 11, 2024
d9c7ab2
Fixes
benjackwhite Apr 12, 2024
1412ffd
Fix
benjackwhite Apr 12, 2024
004ba76
Fix
benjackwhite Apr 12, 2024
f7c9e78
Fixes
benjackwhite Apr 12, 2024
a9c51fb
Fix
benjackwhite Apr 12, 2024
4372aa1
it can be undefined maybe
pauldambra Apr 12, 2024
a6f548b
Added skipping for heatmaps on snapshots
benjackwhite Apr 18, 2024
dc260f8
Merge branch 'main' into feat/heatmaps-part2
benjackwhite Apr 18, 2024
d46b885
fix
benjackwhite Apr 18, 2024
0cbf653
Fixes
benjackwhite Apr 18, 2024
c79d24c
Fixes
benjackwhite Apr 18, 2024
b18767a
fix
benjackwhite Apr 18, 2024
c2f13a2
fix
benjackwhite Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cypress/e2e/opting-out.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ describe('opting out', () => {
describe('session recording', () => {
beforeEach(() => {
cy.intercept('POST', '/decide/*', {
config: { enable_collect_everything: false },
editorParams: {},
featureFlags: ['session-recording-player'],
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
},
capture_performance: true,
autocapture_opt_out: true,
}).as('decide')

cy.visit('./playground/cypress')
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('opting out', () => {

it('can override sampling when starting session recording', () => {
cy.intercept('POST', '/decide/*', {
config: { enable_collect_everything: false },
autocapture_opt_out: true,
editorParams: {},
isAuthenticated: false,
sessionRecording: {
Expand Down
16 changes: 8 additions & 8 deletions cypress/e2e/session-recording.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ describe('Session recording', () => {
it('captures session events', () => {
start({
decideResponseOverrides: {
config: { enable_collect_everything: false },
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
},
capturePerformance: true,
autocapture_opt_out: true,
},
})

Expand Down Expand Up @@ -83,13 +83,13 @@ describe('Session recording', () => {
beforeEach(() => {
start({
decideResponseOverrides: {
config: { enable_collect_everything: false },
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
networkPayloadCapture: { recordBody: true },
},
capturePerformance: true,
autocapture_opt_out: true,
},
url: './playground/cypress',
options: {
Expand Down Expand Up @@ -126,12 +126,12 @@ describe('Session recording', () => {
beforeEach(() => {
start({
decideResponseOverrides: {
config: { enable_collect_everything: false },
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
},
capturePerformance: true,
autocapture_opt_out: true,
},
url: './playground/cypress',
})
Expand Down Expand Up @@ -364,17 +364,17 @@ describe('Session recording', () => {
})
})

describe.only('with sampling', () => {
describe('with sampling', () => {
beforeEach(() => {
start({
decideResponseOverrides: {
config: { enable_collect_everything: false },
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
sampleRate: '0',
},
capturePerformance: true,
autocapture_opt_out: true,
},
url: './playground/cypress',
})
Expand All @@ -395,9 +395,9 @@ describe('Session recording', () => {
})
})

it.only('can override sampling when starting session recording', () => {
it('can override sampling when starting session recording', () => {
cy.intercept('POST', '/decide/*', {
config: { enable_collect_everything: false },
autocapture_opt_out: true,
editorParams: {},
isAuthenticated: false,
sessionRecording: {
Expand Down Expand Up @@ -441,13 +441,13 @@ describe('Session recording', () => {
cy.reload(true).then(() => {
start({
decideResponseOverrides: {
config: { enable_collect_everything: false },
isAuthenticated: false,
sessionRecording: {
endpoint: '/ses/',
sampleRate: '0',
},
capturePerformance: true,
autocapture_opt_out: true,
},
url: './playground/cypress',
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/surveys.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ describe('Surveys', () => {

beforeEach(() => {
cy.intercept('POST', '**/decide/*', {
config: { enable_collect_everything: false },
editorParams: {},
surveys: true,
isAuthenticated: false,
autocapture_opt_out: true,
}).as('decide')
})

Expand Down
3 changes: 1 addition & 2 deletions cypress/support/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const start = ({
resetOnInit = false,
options = {},
decideResponseOverrides = {
config: { enable_collect_everything: true },
sessionRecording: undefined,
isAuthenticated: false,
capturePerformance: true,
Expand All @@ -27,7 +26,7 @@ export const start = ({
excludedDomains: [],
autocaptureExceptions: false,
...decideResponseOverrides,
config: { enable_collect_everything: true, ...decideResponseOverrides.config },
config: { ...decideResponseOverrides.config },
}
cy.intercept('POST', '/decide/*', decideResponse).as('decide')

Expand Down
1 change: 1 addition & 0 deletions playground/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ if (typeof window !== 'undefined') {
scroll_root_selector: ['#scroll_element', 'html'],
persistence: cookieConsentGiven() ? 'localStorage+cookie' : 'memory',
__preview_process_person: 'identified_only',
__preview_heatmaps: true,
})
;(window as any).posthog = posthog
}
Expand Down
6 changes: 5 additions & 1 deletion playground/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export default function Home() {
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<main>
<h1>PostHog React</h1>
<div className="sticky top-0 bg-white border-b mb-4">
<h1 className="m-0">
<b>PostHog</b> React
</h1>
</div>

<p>The current time is {time}</p>

Expand Down
1 change: 0 additions & 1 deletion playground/session-recordings/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ app.listen(port, () => {

app.post('/decide', function (req, res) {
res.json({
config: { enable_collect_everything: false },
editorParams: {},
featureFlags: ['session-recording-player'],
isAuthenticated: false,
Expand Down
Loading
Loading