Sending the predictions to the website

50 views
Skip to first unread message

Webteam SHUZ

unread,
Mar 29, 2021, 11:47:43 AM3/29/21
to cloud-recommendations-users
Hi,

I've setup the data inputs from google merchant and the tags on tag manager. I want to start trining a model but before that I'm still having a hard time understanding how I send the predictions to the front end of the website from the given documentation. Has anyone successfully done? If so can you give some point about the process needed to do so?

Thanks alot in advance!

Peng Ren

unread,
Mar 30, 2021, 1:05:11 AM3/30/21
to cloud-recommendations-users
Hi Shuz,

We would like to understand your question better. By "send the predictions to the front end of the website", do you mean after you get prediction results from Recommendations AI API service, you would like to send the results from your backend server to your website to show them to end users? If so, it's a very client specific question: depending on how the clients set up their application, the answer could be very different so that we do not have the documentation to cover this part. In general, most of the applications set up like this: end user interacts retailer's website and triggers a recommendation request(for example by clicking into a product detailed page), a RPC call is sent from retailer's website to retailer's backend server to get recommendations for the end user, retailers' backend server then calls Recommendations AI service to get prediction results, and the results are all the way propagated to the retailer's website. Please let us know if you need further help. Thanks.

Best,

Peng

Nicholas Edelman

unread,
Mar 30, 2021, 10:52:00 AM3/30/21
to Peng Ren, Eric Larson, cloud-recommendations-users

--
You received this message because you are subscribed to the Google Groups "cloud-recommendations-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-recommendatio...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-recommendations-users/5f2d93e8-2097-4457-b7c3-c65a781e9421n%40googlegroups.com.

elarson

unread,
Apr 2, 2021, 8:03:50 PM4/2/21
to cloud-recommendations-users

The most common implementation calls predict on the backend and returns the recommendations as part of the page.
But if you want to do it client side, asynchronously, that's fine too.  There's nothing in the API currently that supports this directly, and since you do want to use a service account for authentication of predict requests, you do need to wrap the API in some code that can be called by javascript.  I have a simple example using a Google Cloud Function here:

This is a little outdated now, using the Beta API with a predict key - now you would just use a service account.  I can rewrite this to use the new Retail API.
 
On Tuesday, March 30, 2021 at 7:52:00 AM UTC-7 Nicholas Edelman wrote:

On Mon, Mar 29, 2021 at 10:05 PM 'Peng Ren' via cloud-recommendations-users <cloud-recommendations-users@googlegroups.com> wrote:
Hi Shuz,

We would like to understand your question better. By "send the predictions to the front end of the website", do you mean after you get prediction results from Recommendations AI API service, you would like to send the results from your backend server to your website to show them to end users? If so, it's a very client specific question: depending on how the clients set up their application, the answer could be very different so that we do not have the documentation to cover this part. In general, most of the applications set up like this: end user interacts retailer's website and triggers a recommendation request(for example by clicking into a product detailed page), a RPC call is sent from retailer's website to retailer's backend server to get recommendations for the end user, retailers' backend server then calls Recommendations AI service to get prediction results, and the results are all the way propagated to the retailer's website. Please let us know if you need further help. Thanks.

Best,

Peng

On Monday, March 29, 2021 at 8:47:43 AM UTC-7 shuz.w...@gmail.com wrote:
Hi,

I've setup the data inputs from google merchant and the tags on tag manager. I want to start trining a model but before that I'm still having a hard time understanding how I send the predictions to the front end of the website from the given documentation. Has anyone successfully done? If so can you give some point about the process needed to do so?

Thanks alot in advance!

--
You received this message because you are subscribed to the Google Groups "cloud-recommendations-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-recommendations-users+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages