Client IP Forwarding
Forwarding Client IPs to the B2C Commerce platform is a prerequisite for services such as geolocation. You can use any of the following options to pass shopper client IPs to the B2C Commerce platform.
In Custom API implementations and hooks, you can access the client IP using the Script API method Request.getRemoteAddress().
You can use the Shopper Context API API to pass a client IP to the B2C Commerce Platform. The client IP can be stored in the shopper profile and used in subsequent requests.
In Business Manager > {Your-Site} > Merchant Tools > SEO > Customer CDN Settings, you can configure Custom Client IP Header Names. For each request the B2C Commerce API will use this setting to retrieve the client IP address from the request header instead of the CDN network connection source address. If the request header isn't provided, the CDN connection source address will be used.
- If both options are used, Shopper Context takes precedence.