> ## Documentation Index
> Fetch the complete documentation index at: https://docs.global-e.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Session Custom Attributes

Global-e stores localization and mode flags on the SFCC session. The storefront extension cartridges (`int_globale_sfra`, `int_globale_sitegenesis`) copy key values to **`session.custom`** during the `onInit` hook so you can use them in Business Manager customer groups, promotions, and ISML templates.

<Note>
  **Scope:** the top-level `session.custom.ge*` attributes below are written by the `globale.onInit` handler registered in `int_globale_sfra` / `int_globale_sitegenesis`. Popups-only sites and headless-only sites do not register that handler, so they do not get these attributes out of the box — add a custom `globale.onInit` handler if you need them.
</Note>

See also: [Customer Groups](/customer-groups-sfcc), [Cookies](/cookies-sfcc), [Customization](/customization-sfcc), [Hooks — onInit](/hooks-sfcc).

## Attributes on `session.custom` (Business Manager rules)

These attributes are set when Global-e (re)initializes — on the first visit and whenever the country, currency, culture, or locale changes (not on every request). Use **`session.custom.<name>`** in Dynamic Customer Group membership rules (see demo groups in repo `metadata/demo/demo.customergroup.xml`).

| Attribute | Type | Description | Default | Sample |
| - | - | - | - | - |
| geCountry | String | Selected or geo-identified country ISO2 code | — | GB |
| geIsOperated | Boolean | Whether the selected country is operated by Global-e | false | true |
| geCurrency | String | Selected currency ISO3 code | — | GBP |
| gePriceStrategy | String | Country price strategy: `FIXED` or `DYNAMIC` | DYNAMIC | FIXED |

## Additional session keys (scripts and templates)

| Attribute | Type | Description |
| - | - | - |
| geInited | Boolean | `true` after Global-e init completed for the session; `false` when Global-e is disabled |
| geAppState | String (JSON) | Serialized app state — see nested fields below |
| geAppScenario | String (JSON) | Application scenario (default type `storefront`) for advanced flows |

### Fields inside `geAppState` (JSON)

Read with `require('*/cartridge/models/globale/session').getAppState()` — **not** available as top-level `session.custom` paths in BM rules.

| Field | Type | Description | Sample |
| - | - | - | - |
| geEnabled | Boolean | Site preference Global-e Enabled | true |
| geCountry | String | Same as `session.custom.geCountry` | GB |
| geCurrency | String | Same as `session.custom.geCurrency` | GBP |
| geCulture | String | Global-e culture code for the country/locale | en-GB |
| geLocale | String | SFCC request locale | en\_GB |

Culture and locale are persisted in `geAppState` and mirrored to the [Global-e cookie](/cookies-sfcc); they are **not** copied to `session.custom.geCulture` or `session.custom.geLocale`.

## Checking operated country in templates

For ISML, the cartridges typically use the app context factory (same logic as `geIsOperated`):

```xml theme={null}
<isset name="geAppContext" value="${require('*/cartridge/scripts/factories/globale/geAppContextMgr').getAppContext()}" scope="page"/>
<isif condition="${!geAppContext.country.isOperated()}">
    <!-- domestic-only UI -->
</isif>
```

Alternatively, `session.custom.geIsOperated` works when set (after init):

```xml theme={null}
<isset name="globaleSession" value="${require('*/cartridge/models/globale/session')}" scope="page"/>
<isif condition="${!globaleSession.get('geIsOperated')}">
    <!-- domestic-only UI -->
</isif>
```

See [Customization](/customization-sfcc) for a cart-page example.
