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(headless-commerce): use getVisitorID to set clientId #3628

Merged
merged 3 commits into from
Feb 26, 2024

Conversation

sallainCoveo
Copy link
Contributor

@sallainCoveo sallainCoveo commented Feb 22, 2024

Jira: https://coveord.atlassian.net/browse/LENS-1525

First part to potentially improve attribution. Previously, the clientId was set in the state, using an action to update the commerceContext. This branch is to instead fetch the clientId for the commerce API's request. To do so, I'm using the getVisitorID function from coveoua. Although we want to focus on Relay in the future, we will be using the stable functionality used across the package for now. Beside, the clientId value should be the same for both analytics' package.

To test it, I've linked the local build to barca sport to test this change. The first part of the following demo is from the current state of Barca sports in DEV, then the second part is what is done is in a local environment:

demo_headless_clientid_from_relay.mp4

When it's merge, we can update Barca sports.

Copy link

github-actions bot commented Feb 22, 2024

Pull Request Report

PR Title

✅ Title follows the conventional commit spec.

Bundle Size

File Old (kb) New (kb) Change (%)
case-assist 222.4 222.4 0
commerce 330.9 331 0
search 406.3 406.4 0
insight 335.4 335.5 0
product-listing 338.3 338.4 0
product-recommendation 189.2 189.2 0
recommendation 236.9 236.9 0
ssr 375.6 375.7 0

@sallainCoveo sallainCoveo changed the title Feat lens 1525 get client id from relay feat(commerce): get clientId from relay instead of setting in the state Feb 22, 2024
@sallainCoveo sallainCoveo changed the title feat(commerce): get clientId from relay instead of setting in the state feat(headless-commerce): get clientId from relay Feb 22, 2024
@sallainCoveo sallainCoveo force-pushed the feat-LENS-1525-get-clientId-from-Relay branch from 3ea49f8 to d2d1f3c Compare February 22, 2024 00:41
Copy link
Contributor

@Spuffynism Spuffynism left a comment

Choose a reason for hiding this comment

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

Looks great!

@sallainCoveo sallainCoveo changed the title feat(headless-commerce): get clientId from relay feat(headless-commerce): use getVisitorID to set clientId Feb 22, 2024
Copy link
Contributor

@samisayegh samisayegh left a comment

Choose a reason for hiding this comment

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

Looks great ✅

@sallainCoveo sallainCoveo force-pushed the feat-LENS-1525-get-clientId-from-Relay branch from f6db53a to 077b1f9 Compare February 22, 2024 20:56
Copy link
Contributor

@fbeaudoincoveo fbeaudoincoveo left a comment

Choose a reason for hiding this comment

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

💯

@sallainCoveo sallainCoveo merged commit 7adf769 into master Feb 26, 2024
89 checks passed
@sallainCoveo sallainCoveo deleted the feat-LENS-1525-get-clientId-from-Relay branch February 26, 2024 15:49
@louis-bompart louis-bompart restored the feat-LENS-1525-get-clientId-from-Relay branch February 26, 2024 17:16
louis-bompart added a commit that referenced this pull request Feb 26, 2024
sallainCoveo added a commit that referenced this pull request Feb 27, 2024
* feat(commerce): get clientId from Relay instead of state

* refactor(event-protocol-utils): set getClientId method

* refactor(headless-commerce): use getVisitorId
github-merge-queue bot pushed a commit that referenced this pull request Feb 27, 2024
* feat(headless-commerce): use getVisitorID to set clientId (#3628)

* feat(commerce): get clientId from Relay instead of state

* refactor(event-protocol-utils): set getClientId method

* refactor(headless-commerce): use getVisitorId

* fix(commerce-face-search-request-builder): set await to builder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants