当购物者在 Hello 小组件中选择不同的国家/地区时,Zonos 需要在购物者浏览您的网站时记住该选择。helloSettings 中的 countryOverrideBehavior 设置控制如何保持该国家/地区选择。
helloSettings
countryOverrideBehavior
URL_PARAM
?zCountry=XX
window.history.replaceState()
SESSION
zonos--country
默认值为 URL_PARAM。
在 Zonos.init 调用中设置 helloSettings 中的 countryOverrideBehavior 属性:
Zonos.init
Zonos.init({
// ... other settings
helloSettings: {
countryOverrideBehavior: 'URL_PARAM',
},
});
Hello 按以下顺序检查选定的国家/地区:
zCountry
country
customerCountry
sessionStorage
无论您选择哪种 countryOverrideBehavior,当购物者进行选择时,国家/地区始终保存到会话存储。该设置控制 URL 是否也会更新。
国家/地区覆盖行为
国家/地区覆盖行为
控制 Hello 如何记住购物者选择的国家/地区。当购物者在 Hello 小组件中选择不同的国家/地区时,Zonos 需要在购物者浏览您的网站时记住该选择。
helloSettings中的countryOverrideBehavior设置控制如何保持该国家/地区选择。可用选项
URL_PARAM?zCountry=XX。这允许共享和书签保存特定国家/地区的 URL。URL 使用window.history.replaceState()进行更新,无需页面重新加载。SESSIONzonos--country。当购物者浏览网站时保持该选择,但在浏览器标签页或会话结束时清除。默认值为
URL_PARAM。配置国家/地区覆盖行为
在
Zonos.init调用中设置helloSettings中的countryOverrideBehavior属性:Zonos.init({// ... other settingshelloSettings: {countryOverrideBehavior: 'URL_PARAM',},});何时使用每个选项
URL_PARAM
SESSION
国家/地区检测如何工作
Hello 按以下顺序检查选定的国家/地区:
zCountry。还支持旧版参数country和customerCountry作为备选。sessionStorage中的zonos--country键。无论您选择哪种
countryOverrideBehavior,当购物者进行选择时,国家/地区始终保存到会话存储。该设置控制 URL 是否也会更新。这个页面有帮助吗?