Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Mutations can be used to update the product catalog in Nosto. The updateProducts
mutation allows you to update one or more products at a go.
Any validation errors in the product data are accessible in the response. The entire product object is accessible in the response too. In the event that a product validation error led to the product to not be updated, the response would contain the errors as well as the invalid product data.
The given example updates the product #101 and requests the details of the updated products and any associated errors.
The given example updates the price of #101 and requests the details of the updated products and any associated errors.
Mutations can be used to update the category listing in Nosto. The upsertCategories
mutation allows you to update one or more category at one go. If the category doesn't already exist, a new one is created.
A category can have the following fields:
id
The category identifier. If a category with this id doesn't already exist, a new one is created.
name
The displayed name for the category.
urlPath
The path that can be used to generate the URL of the category listing.
available
If the category is visible on the store. This can be set to false to soft delete the category in an upsert.
Some stores support hierarchical categories i.e. a category may have parent and child categories. The following fields can be used for hierarchical categories:
parentId
The identifier of the parent category.
fullName
The name of every category in the hierarchy.
The mutation methods allow you to change the session on Nosto's end and request personalized recommendations. Each mutation operation allows you to update the cart and customer information, all while giving you access to recommendations for the sessions.
Any mobile experience built atop Nosto's GraphQL API should use the mutation operation as it feeds data into to the recommender systems while providing personalization data.
_The given example updates the customer's information and his current shopping cart contents sends an event that the customer is currently viewing product number 400 and requests the personalized recommendations associated with a given product for him aliased as front_page_1
.
Mutations can be used to update the email identities in Nosto. An "identity" is the personal information associated with an email address.
The upsertIdentity
mutation allows you to upsert the details of an identity. The given example updates the customer attributes for the email john.doe@nosto.com and requests the details of all the attributes of the identity.
If the identity for john.doe@nosto.com does not exist, a new identity will be created.
Note: If a specified attribute already exists on that identity, it will be overwritten.
The attributes associated with an identity can be used to segment users. This works similarly to how the attributes can be leveraged when importing them via a CSV.
There is currently no way to delete an identity.
If you would like to update the order-status for a given order, you can do so using the following request.
When a new user comes to the app, you can use this method to get a new session. It will return you a customer-id that can save on the device and use for future requests. This would be ideal.
When a customer logs in, you can update the existing customer with the customer-reference. This would merge the online and mobile sessions. If not needed, I would omit this for now.
In order to use the GraphQL session mutation to fetch recommendations for your search page, the event, in this case, must be VIEWED_PRODUCT
and you should specify the product-identifier of the current product being viewed.
In order to use the GraphQL session mutation to fetch recommendations for your category page, the event, in this case, must be VIEWED_CATEGORY
and you should specify a fully qualified category path of the current category. For example, if you have a category called "Dresses" under the category "Women", the FQCN would be "/Women/Dresses".
In order to use the GraphQL session mutation to fetch recommendations for your search page, the event, in this case, must be SEARCHED_FOR
and you should specify the search term of the query.
In order to use the GraphQL session mutation to fetch recommendations for your cart or checkout page, the event, in this case, must be VIEWED_PAGE
and you should specify a fully qualified URL of the page as the target.
In order to use the GraphQL session mutation to fetch recommendations for your home or front page, the event, in this case, must be VIEWED_PAGE
and you should specify a fully qualified URL of the page as the target
Recommendation results can be attributed to events by setting a session event's ref
to the recommendation result's resultId
.
Here is an example of some recommendations for a front page. You can see recommendation result's resultId
is "frontpage-nosto-1"
.
If a customer selects to view the Cool Kicks product, you can generate the following request. Note that the event's ref
is set to "frontpage-nosto-1"
.
When making GraphQL queries from mobile applications, it's essential to define the user agent string in your HTTP headers. Ideally, the user agent should represent the mobile environment, including details such as the platform, device type, and application version. Avoid using terms like "bot" in the user agent string, as this might lead to unintended behavior or rejection of the query/session. Sending an empty user agent will also lead to be catch by the bot detection mechanism.
When a user places an order onsite or offsite, you must send the conversion tracking information to Nosto.
Orders can be associated with a customer either by customer reference or by customer id. The customer id matches the Nosto cookie (this cookie is typically called 2c.cId
).
Tracking orders by customer id looks like the following:
To fetch the recommendations for the order-confirmation page, simply use the GraphQL field called forOrderPage
to fetch all the recommendations for the order-confirmation page.