Engage.updatePointOfSale(pointOfSale)
The updatePointOfSale()
function updates the value of pointOfSale
that you previously specified in the settings object. Then, every event that you send inside the scope of this function will automatically include the updated point of sale.
Here's an example of a scenario where an organization uses multiple points of sale. The default point of sale is specified as "myretailsite"
in the settings object. If certain conditions are met, the point of sale is updated to "myretailsite/europe"
. Then, a VIEW event is sent with the new point of sale.
RequestResponse
import { init } from "@sitecore/engage";
const loadEngage = async () => {
const engage = await init({
// ...
pointOfSale: "myretailsite"
});
if (region === "europe") {
engage.updatePointOfSale("myretailsite/europe");
engage.pageView({
// ...
});
};
};