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(screeb): identify on init #1990

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

samber
Copy link
Contributor

@samber samber commented Apr 15, 2024

At Screeb, we need to identify users when the tag is initialized. If we do it later, then the tag will create an identify for a short period (between init() and identify()). Customers are disappointed by this behavior, so we inject the segment userId.

AnonymousId is ignored since Screeb does not have such a concept.

@samber samber requested review from a team as code owners April 15, 2024 11:46
@samber samber requested a review from a team April 15, 2024 11:46
@joe-ayoub-segment joe-ayoub-segment self-assigned this Apr 16, 2024
@@ -71,7 +72,12 @@ export const destination: BrowserDestinationDefinition<Settings, Screeb> = {
await deps.loadScript('https://t.screeb.app/tag.js')
await deps.resolveWhen(() => window.$screeb !== preloadFunction, 500)

window.$screeb('init', settings.websiteId)
let visitorId: ID = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @samber - not sure if the ID type needs to be imported.
Can you just do this please?

let visitorId: string | null | undefined = null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed ✅

@joe-ayoub-segment joe-ayoub-segment merged commit 0849b3f into segmentio:main Apr 22, 2024
5 of 11 checks passed
@joe-ayoub-segment
Copy link
Contributor

Hi @samber - this PR has been deployed. Please confirm that it looks correct to you!

@samber
Copy link
Contributor Author

samber commented Apr 24, 2024

@joe-ayoub-segment i just tested and it works very well, thanks ;)

@samber samber deleted the feat-screeb-identify-on-init branch April 24, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants