Skip to main content
Load the Global-e Client JS SDK on every storefront page. It drives the Welcome pop-up, standard Country Switcher, Checkout iframe, and Client-side analytics. Related: Customization · Configuration · Checkout flow · Session attributes Any Global-e function, which is defined in Client JS SDK can be called (executed) only when the Client JS SDK itself is loaded and the following JavaScript functions are triggered: How the cartridge initializes the SDK: the cartridge loads the SDK script and configures it in int_globale_{architecture}/cartridge/client/default/js/geScriptLoader.js using server-rendered values exposed on window.geScriptLoaderData. The key calls are:
The values come from the server (Globale-ScriptLoaderData), so you normally do not hard-code the hostname or cookie domain. Other SDK methods such as GlobalE.SetMerchantParameters({...}) belong to the external Global-e Client SDK API and are not invoked by the SFCC cartridge. More details about the Global-e Client JS SDK, available commands and functions are in the Global-e Client SDK online document.
In the paths below, {architecture} is sfra or sitegenesis (or the matching *_popups cartridge). The headless cartridge uses int_globale_headless/cartridge/client/default/js/globaleClientScripts.js for the same SDK calls and does not ship the SFRA/SiteGenesis iframe.isml checkout template (headless checkout is rendered by the PWA/front end).

Global-e Welcome pop up

The Welcome pop-up for international customers can be integrated with two ways:
  • Standard - Global-e Client JS SDK will show the welcome pop-up (enabled by default), based on the configuration made on the Global-e side, only for Global-e operated countries.
    The layout, look & feel and other elements of the Standard Global-e welcome pop-up is configured on the Global-e side and will be applied on the merchant storefront by Global-e Client JS SDK automatically.
    Standard Global-e welcome pop-up can be initialized by executing the JavaScript function:
    It is triggered in int_globale_{architecture}/cartridge/client/default/js/geScriptLoader.js file.
  • Custom - You are fully free to implement your own custom Welcome pop-up using standard SFCC content slots/assets, templates and any other components.
    The Standard Global-e welcome pop-up should be disabled on the Global-e side.

Global-e Country Switcher

If you want to use the Standard Global-e Country Switcher (enabled by default) - you don’t have to do anything on your platform, it is already available in our cartridge.
You need only to provide the requirements and design of your Country Switcher to your Global-e Project/Account manager and it will be configured on the Global-e side only.
Once the predefined event (by default defined in int_globale_{architecture}/cartridge/client/default/js/geScriptLoader.js) is triggered on your storefront - Global-e Client JS SDK will show the Country Switcher pop-up.
Once the customer has selected Country/Currency and clicked on Save/Submit button - the Country Switcher pop up will be closed and the page will be refreshed staying on the same URL or redirecting to the predefined Site URL to the selected Country (if it’s configured so). You can change the look & feel of the Standard Global-e Country Switcher by providing your design (HTML CSS and JS) to your Global-e Account/Project Manager.
The Global-e country switcher can be styled according to your designs.
Standard Global-e Country Switcher can be initialized by executing the JavaScript function:
The SFRA cartridge may pass an optional fifth argument (callback handler). Calls are triggered from int_globale_{architecture}/cartridge/client/default/js/geScriptLoader.js. Global-e cartridges allow:
  1. Display Global-e country switcher on SFCC sites operated and not operated by Global-e.
    On non-operated SFCC sites you can display the Global-e country switcher by adding int_globale_sfra_popups or int_globale_sitegenesis_popups, which contain a simple version of the Global-e integration used only for displaying the country switcher.
  2. Redirect to the same page in the scope of one site or across different SFCC sites.
    In the current context ‘redirect’ means in case of the changing country/language/currency.
    The redirect works properly only if at the end of the site’s path is existed action/page location (for example homepage, cartpage, etc.)
  3. Define allowed/disallowed countries for the site.
    Global-e country switcher allows defining allowed/disallowed countries for the site.
    For disallowed countries as a fallback will be preselected site default country.
  4. Define allowed/disallowed countries for the locale.
    Global-e country switcher allows defining allowed/disallowed countries for the locale.
    For disallowed countries as a fallback will be preselected site default country.
  5. Define only one allowed country for the locale.
    Makes sense to use only if each country has its own locale.
  6. Use different domains across SFCC sites and set the correct country during redirection.
  7. Use language selector for countries.
    Global-e country switcher allows using multiple languages in the scope of one country.
  8. Set the right language of the welcome popup depending on the selected language in the selector.

Installation of Global-e country switcher on non-operated SFCC sites

For sites that only need the Welcome pop-up and Country Switcher (no full Global-e checkout), use the popups cartridges — see Cartridges and Installation: Upload both cartridges, import metadata, add them to the site cartridge path (popups extension before int_globale), then configure site preferences and run GlobaleSettings — details in Configuration. Required site preferences (Merchant Tools → Site Preferences → GLOBALE): Global-e Enabled, Global-e API URL, Client JS Merchant ID, Merchant GUID, plus any mandatory fields required to save changes. Shipping switcher layout is configured on the Global-e side with your project team. The default implementation of the Global-e country switcher works out of the box with Global-e cartridges.
The selected country is determined and set in the SFCC backend. In int_globale_{architecture}/cartridge/client/default/js/geScriptLoader.js, logic can show the country switcher once when geolocation country differs from the selected country.

Custom Country Switcher

Country list

The list of all available Countries for the Merchant can be obtained from GLOBALE_COUNTRIES Custom Object.
Each Global-e Country:
  • is an instance of Country configured on the Global-e side, and stored into GLOBALE_COUNTRIES Custom Object by running scheduled GlobaleSettings Job
  • has Name (“name” {string} custom attribute of Custom Object)
  • has ISO2 Country Code (“code” {string} custom attribute of Custom Object)
  • can be operated/non-operated by Global-e (“isOperatedByGlobalE” {boolean} custom attribute of Custom Object)
  • has default ISO3 Currency Code (“defaultCurrencyCode” {string} custom attribute of Custom Object)
  • can have a Site URL, where the customer should be redirected to if the customer selects this country (“siteUrl” {string|null} custom attribute of Custom Object)

Country Site redirect URL

The Site URL on the Global-e side for each operated or non-operated country (present in the Country Switcher) can be empty, set as a string (static URL) or special format, which should be used on the SFCC side for generating the real static URL.
If it’s empty (or not set) - the customer will not be redirected to any custom Site URL, the page will be just refreshed and the customer will stay on the same page with the same URL parameters.
If it’s set as a string (static URL) - it should contain http(s):// or www. in it, so the script in the int_globale cartridge will properly identify it. In this case, the customer will be redirected to the URL specified for this country.
If it’s set in the special format “action|SiteID|locale[|hostName|[URLParameters]]” - the end Site URL should be first generated by Salesforce B2C Commerce Digital (by default in int_globale cartridge), returned to front-end and then used as the final Site redirect URL.
Here are the parameters of the special Site URL format:
  • action - standard SFCC action (i.e. “Home-Show”)
  • SiteID (optional) - standard SFCC Site ID (i.e. “RefArch”). If present - will be used to replace the Site ID in the URL.
  • locale - standard SFCC request locale (i.e. “en_US”)
  • hostName (optional) - the host which is different from the main host of the current storefront. Must be defined properly in SFCC BM for any available Site, otherwise, it won’t work. If present - will be used to replace the current storefront host in the URL.
  • URLParameters (optional) - any additional URL parameters denoted by vertical line (”|”) which should be passed to the end Site URL, in format parameter1=value1|parameter2=value2|…|parameterN=valueN. If present - will be added as additional URL parameters to the final Site redirect URL.
For example, the following Site URL (configured on the Global-e side for selected Country) “Home-Show|RefArch|en_US|demo.merchant.com|source=12345678” will be parsed and generated to the “https://demo.merchant.com/s/RefArch/home?source=12345678” final Site redirect URL.

Currency list

The list of all supported by Global-e Currencies can be obtained from GLOBALE_CURRENCIES Custom Object.
Each Global-e Currency:
  • is an instance of Currency configured on the Global-e side, and stored into GLOBALE_CURRENCIES Custom Object by running scheduled GlobaleSettings Job
  • has Name (“name” {string} custom attribute of Custom Object)
  • has ISO3 Currency Code (“code” {string} custom attribute of Custom Object)
  • has Currency Symbol (“symbol” {string} custom attribute of Custom Object)
  • has Max Decimal Places (“maxDecimalPlaces” {int} custom attribute of Custom Object)

Global-e Free Shipping Banner

Free shipping promotions for Global-e operated countries are managed on the Global-e platform and can be configured for each country individually.  Allow us to display a free shipping promotion banner on your site by adding the container below either directly to your header template or via a content slot. Please note that if you choose to add it via the content slot, this content slot needs to be configured and active at all times.  

Global-e Checkout

Global-e Checkout loads in an iframe within the standard SFCC container (default template int_globale_{architecture}/cartridge/templates/default/globale/checkout/iframe.isml). See Checkout flow.

Checkout Analytics Data Implementation

Once a customer started the Global-e checkout flow, Global-e Client JS SDK will notify the client (customer browser parent window from Global-e Checkout iframe) on every step loaded via triggering a JavaScript event. For some steps, basket/order data is passed to the handler. By default, the OnCheckoutStepLoaded event will be triggered twice, once for the initial checkout page load and the second time for the checkout confirmation page. Please note that when OnCheckoutStepLoaded is triggered on the Global-e checkout confirmation page, the SFCC order may not yet be created.
Therefore, it is crucial to work with and retrieve all necessary details/info from the input data object, which is passed as an argument to OnCheckoutStepLoaded.
Here is the example of how the Checkout Analytics Data can be integrated into your int_globale_{extension}/cartridge/client/default/js/geScriptLoader.js:
More information could be found in this article.