From 1c1d9454607c711033e810cf3ca861ba5c5d18bd Mon Sep 17 00:00:00 2001 From: Fanny Date: Wed, 25 Oct 2023 16:44:40 -0300 Subject: [PATCH 1/2] docs: Updates search.ts file link --- .../vtex/intelligent-search-reports.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md b/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md index 240a0b8b..6099198d 100644 --- a/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md +++ b/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md @@ -35,7 +35,7 @@ You should also consider that: In the Next JS starters, they are the `ProductGalleryQuery` and `SearchSuggestionsQuery`. -> Not every search query is full-text. You can consider a search query as being full-text if the query variable `term` is not empty. +> Not every search query is full-text. You can consider a search query as being full-text if the query variable `term` is not empty. 2. Add the metadata fragment to above one of the queries @@ -133,9 +133,9 @@ export interface IntelligentSearchQueryEvent { } ``` -2. Add `onSucess` callback to search query callers +2. Add `onSuccess` callback to search query callers -Find out where the queries are being called and add an `onSucess` callback that fires the `intelligent_search_query` event to each of them. +Find out where the queries are being called and add an `onSuccess` callback that fires the `intelligent_search_query` event to each of them. These events should include the required data based on the event type added in step 1. For that, you might need to call hooks to gather the necessary information, such as the current `locale`. @@ -165,13 +165,13 @@ useQuery(query, localizedVariables, { ### Step 3 - Send the event to Intelligent Search -Update the `src/sdk/analytics/platform/vtex/search.ts` file to look exactly like [this copy](https://github.com/vtex-sites/nextjs.store/blob/955742acaeba8cce078bae558fa0ceb966eaa2d6/src/sdk/analytics/platform/vtex/search.ts) of that same file. +Update the `src/sdk/analytics/platform/vtex/search.ts` file to look exactly like [this copy](https://github.com/vtex-sites/nextjs.store/blob/d8f6a82aa161209ecc75550a3a0fa5b94c72e2cf/src/sdk/analytics/platform/vtex/search.ts) of that same file. This will update the analytics Search handler to deal with the newly created `intelligent_search_query` event. ## Considerations -The effect of these changes on the Intelligent Search Analytics page can take up to 8 hours. You can check if you have implemented everything correctly by looking for requests to https://sp.vtex.com/event-api/v1 on your browser's Network Tab +The effect of these changes on the Intelligent Search Analytics page can take up to 8 hours. You can check if you have implemented everything correctly by looking for requests to https://sp.vtex.com/event-api/v1 on your browser's Network Tab. --- From 2cd452c722a04524ec353c72898b3d3ddabf9044 Mon Sep 17 00:00:00 2001 From: Fanny Date: Wed, 25 Oct 2023 16:45:43 -0300 Subject: [PATCH 2/2] docs: Adds vtex IS reference link --- .../platform-integration/vtex/intelligent-search-reports.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md b/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md index 6099198d..9c282de4 100644 --- a/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md +++ b/docs/how-to-guides/platform-integration/vtex/intelligent-search-reports.md @@ -177,4 +177,5 @@ The effect of these changes on the Intelligent Search Analytics page can take up ## Additional resources -[Next.js starter Pull Request - reference](https://github.com/vtex-sites/nextjs.store/pull/373) +- [Next.js starter Pull Request - reference](https://github.com/vtex-sites/nextjs.store/pull/373) +- [VTEX Intelligent Search Analytics - reference](https://help.vtex.com/tracks/vtex-intelligent-search--19wrbB7nEQcmwzDPl1l4Cb/3JcuptYAkwr1GLZEM3IQ2m)