C15T Logo

Location Info

How to view and update the user's location

The locationInfo property stores the user's location (for example, to determine whether to show an EU GDPR banner).

This property is updated when the consent banner is fetched, and defaults to null when the location cannot be determined, such as in offline mode. The location information can be updated via the setLocationInfo() method, which accepts a LocationInfo object or null.

Usage

setLocationInfo({
  countryCode: 'US',
  regionCode: 'CA',
  jurisdiction: 'CCPA'
});

console.log(locationInfo);

Returns

Property
Types