-
Notifications
You must be signed in to change notification settings - Fork 125
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
Referrer first and last touch #139
Conversation
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "posthog-js", | |||
"version": "1.7.1", | |||
"version": "1.7.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
? weird - not sure why this + featureflags.js tests are showing up here.
Maybe worth rebasing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soz, hadn't pushed this from my hotfix this weekend. This is now in master and rebased. Feature flag is a legit small cleanup
2c7a368
to
8b258cd
Compare
@@ -1,6 +1,6 @@ | |||
import { PostHogFeatureFlags } from '../posthog-featureflags' | |||
|
|||
fdescribe('featureflags', () => { | |||
describe('featureflags', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is legit, cleaning up fdescribe left behind in atest
@@ -1,6 +1,6 @@ | |||
import { PostHogFeatureFlags } from '../posthog-featureflags' | |||
|
|||
fdescribe('featureflags', () => { | |||
describe('featureflags', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is legit, cleaning up fdescribe left behind in atest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small issues, otherwise lgtm.
Ideally we'd also cover user properties with a cypress-based smoke test as well but not necessary as part of this PR.
src/__tests__/posthog-persistence.js
Outdated
|
||
given('lib', () => Object.assign(new PostHogPersistence({ name: 'bla', persistence: 'cookie' }), given.overrides)) | ||
|
||
fdescribe('persistence', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe
> fdescribe
src/__tests__/posthog-persistence.js
Outdated
@@ -0,0 +1,30 @@ | |||
import { PostHogPersistence } from '../posthog-persistence' | |||
|
|||
given('lib', () => Object.assign(new PostHogPersistence({ name: 'bla', persistence: 'cookie' }), given.overrides)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: given('persistence', () => new PostHogPersistence({ name: 'bla', persistence: 'cookie' }))
- no need for overrides here (it's an artifact of core being stupid complex that it's even needed), this simplifies the test at hand.
Changes
Based on a conversation with a user, they were interested in knowing what last touch referrer led to a purchase. This wasn't possible, as we only set the referrer on the first page visit, but not on subsequent page visits within that session.
This correctly sets the $referrer and $referrer_domain in persistence so that it's always set to the last touch referrer.
In the interface this is how we explain this behaviour as well, but turns out we aren't doing this correctly:
cc @jamesefhawkins as you know more about first/last touch than me. Does this sound right to you?
Checklist