Control how Hello remembers a shopper's selected country.
When a shopper selects a different country in the Hello widget, Zonos needs to remember that selection as the shopper navigates your site. The countryOverrideBehavior setting in helloSettings controls how this country selection is persisted.
Persists the selected country in the URL query string as ?zCountry=XX. This allows country-specific URLs to be shared and bookmarked. The URL is updated using window.history.replaceState() without a page reload.
SESSION
Persists the selected country in the browser's session storage under the key zonos--country. The selection is maintained as the shopper navigates but clears when the browser tab or session ends.
Hello checks for the selected country in the following order:
URL parameter - Looks for zCountry in the URL query string. Also supports legacy parameters country and customerCountry as fallbacks.
Session storage - If no URL parameter is found, checks sessionStorage for the zonos--country key.
Geolocation - If neither is set, Hello uses the shopper's detected location.
Regardless of which countryOverrideBehavior you choose, the country is always saved to session storage when a shopper makes a selection. The setting controls whether the URL is also updated.
Country override behavior
Country override behavior
Control how Hello remembers a shopper's selected country.When a shopper selects a different country in the Hello widget, Zonos needs to remember that selection as the shopper navigates your site. The
countryOverrideBehaviorsetting inhelloSettingscontrols how this country selection is persisted.Available options
URL_PARAM?zCountry=XX. This allows country-specific URLs to be shared and bookmarked. The URL is updated usingwindow.history.replaceState()without a page reload.SESSIONzonos--country. The selection is maintained as the shopper navigates but clears when the browser tab or session ends.The default value is
URL_PARAM.Configure country override behavior
Set the
countryOverrideBehaviorproperty in thehelloSettingsof yourZonos.initcall:Zonos.init({// ... other settingshelloSettings: {countryOverrideBehavior: "URL_PARAM",},});When to use each option
URL_PARAM
SESSION
How country detection works
Hello checks for the selected country in the following order:
zCountryin the URL query string. Also supports legacy parameterscountryandcustomerCountryas fallbacks.sessionStoragefor thezonos--countrykey.Regardless of which
countryOverrideBehavioryou choose, the country is always saved to session storage when a shopper makes a selection. The setting controls whether the URL is also updated.Was this page helpful?