API method to manually add a given segment code to the the current user. This
is used in situations when you want to segment users based on external logic.
Sending a segment code does not automatically create the corresponding segment.
API method to create a recommendation request. This should only be used when you
require programmatic access to the Nosto request builder.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto, you must use the defaultSession
method.
Optional
flags: { includeTagging?: boolean }a set of flags to customise to request behaviour (eg. {"includeTagging":true} to initialise the request from the page tagging.
the instance of the request.
API method to resend the provided customer details to Nosto. This is used in situations
when the customer details is loaded after the client script initialization.
If the current customer is not provided, you will not be able to leverage features such as
triggered emails. While it is recommended to always provide the details of
the currently logged in customer, it may be omitted if there are concerns
about privacy or compliance.
It is not recommended to pass the current customer details to the request
builder but rather use the customer tagging.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, usage of this method is indicative of an
incorrect usage pattern. You should be using the Session API
the details of the currently logged in customer
Session#setCustomer
to provide the customer information.
This method is legacy method and therefore named incorrectly. Is the customer equivalent
of the resendCartContent method and actually should be called resendCustomerDetails.
API method to access the default session. This should only be used when implementing
Nosto on a single-page application atop a framework such as React, Vue, Angular or
the likes.
If you are not using a single-page application but require programmatic access to the
Nosto request builder use createRecommendationRequest.
API method to retrieve search affinities and segments and transform it to partial search query.
Results are cached to sessionStorage and is refreshed after cacheRefreshInterval
API method to register a listener for JS API events. Nosto's JS API dispatches
multiple events across the session lifetime.
Due to the wide gamut of events dispatched, listing them all is still a work in
progress.
API method to load Nosto. This function is automatically invoked when the page loads.
API method to reload all onsite recommendations and content. This should only be used when need to
reload all recommendations and content e.g. on a overlay modal.
Incorrect or extraneous usage of this method will lead to skewed page-view
statistics, ad every invocation of this method results in a +1 page-view count.
Optional
element: string | { markNostoElementClicked: string }API method that to debug the state the page tagging. This is useful for debugging
what Nosto sees. You are able to see all the page tagging via the debug toolbar.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, if used, this method will always return
an empty object (as there shouldn't be any tagging/metadata on the page).
This is only for debugging purposes and should never be used in a production environment
the representation of the page tagging
Record search event, should be send on any search
Record search event, should be send on any search
Optional
options: SearchAnalyticsOptionsRecord search click event
Record search click event
Record search submit event (e.g. search form submit). Required to track organic searches.
Record search submit event (e.g. search form submit). Required to track organic searches.
Removes injected content from the supplied divIds If campaign was injected statically, then static placement just clears its contents. If dynamically, the injected element gets removed from DOM
API method to resend the cart content to Nosto. This is used in situations
when the cart tagging is loaded after the client script initialization.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, usage of this method is indicative of an
incorrect usage pattern. You should be using the Session API
Session#setCart to provide the cart information.
API method to resend the cart tagging to Nosto. This is used in situations
when the cart tagging is loaded after the client script initialization. This method
reads all metadata having the class "nosto_cart" and sends the extracted cart
information to Nosto.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, usage of this method is indicative of an
incorrect usage pattern. You should be using the Session API
Resends the cart tagging to Nosto. Only the cart information is sent over and nothing else - no placements, no events, nothing. This method was originally used by the Magento 2 plugin. In the Magento 2 plugin the cart tagging is loaded asynchronously so a method like this was needed.
Session#setCart to provide the cart information.
API method to resend the customer tagging to Nosto. This is used in situations
when the customer tagging is loaded after the client script initialization. This method
reads all metadata having the class "nosto_customer" and sends the extracted customer
information to Nosto.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, usage of this method is indicative of an
incorrect usage pattern. You should be using the Session API
Resends the customer tagging to Nosto. Only the c ustomer information is sent over and nothing else - no placements, no events, nothing. This method was originally used by the Magento 2 plugin. In the Magento 2 plugin the customer tagging is loaded asynchronously so a method like this was needed.
Session#setCustomer to provide the customer information.
Search function which requests graphql search endpoint.
Search function
Optional
options: SearchOptionsAPI method to resend all the tagging to Nosto. This is used in situations when the cart and the customer tagging is loaded after the client script initialization.
While you can use resendCartTagging and the resendCustomerTagging to achieve the
same - this method will make a single request to Nosto.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you do not
ever need this method. Nosto implementations on the single-page applications don't
rely on the tagging metadata and therefore, usage of this method is indicative of an
incorrect usage pattern.
Resends all the tagging to Nosto. Only the page tagging is sent over and nothing else - no placements, no events, nothing. This method was originally used by the Magento 2 plugin. In the Magento 2 plugin the order tagging was loaded asynchronously so a method like this was needed.
API method to disable the automatic initialization of Nosto. This should be used in
cases when you want to manually load content.
If your site is a single-page application atop a framework such as React, Vue, Angular or
the likes, and you are implementing Nosto using the Session API, you must disable
auto-loading.
a true or false value indicating whether to automatically load or not