-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to enable Personalization on NextJS framework server side render? Can't take effect on server side render #598
Comments
Hi @canyan1989
This being an SDK, it's completely upto you on which mechanism you use. The SDK provides localStorage automatic storing and retrieving of the IDs, but you can modify the requests if you are providing the IDs. I hope this helps. |
Hi @jerrypena1 Thanks, It's helpful. And have more question want to confirm: 1> About Point2, if we modify the requests and provides the IDs on server-side requests, but SDK provides localStorage automatic storing and retrieving of the IDs on client-side requests. Is it also correct? |
Hi @canyan1989 1> the personalization modifier that you pass in can optionally accept parameters which allow you to pass in the IDs on the server side. Because you would need to manage the product IDs anyway in order to make this work on the server side, in order to avoid a mismatch of the local & server data for the IDs, I would use the same mechanism to pass in the IDs on the client side as well and bypass using the default localStorage mechanism. |
Hi @jerrypena1 Thanks. We're testing this way: store the IDs on the server-side and tie it to the user's session, retrieve this information and send it when making the server-side requests. |
hi @canyan1989 I'm curious is that worked for you? |
Here is we are using framework: NextJS / React / klevu-core
We use next.js framework, because is good for SEO.
NextJS => klevu-core SDK=> personalisation =>https://github.com/klevultd/frontend-sdk/blob/master/packages/klevu-core/docs/modules/personalisation.md
1> The Personalization will not take effect on server side render. How can we achieve the Personalization functionality when rendering on the server side?
2> how to implement Personalization in a user-friendly way for existing/returning customers that have analytics data already. i.e. not reloading page content => So far one idea for Personalization only take effect on client, it means need to call Klevu API after page load(server side render) and update page content again (client side reloading page content). But we don't want to do it this way.
The text was updated successfully, but these errors were encountered: