Skip to main content

normalize_user_geo

Function normalize_user_geo 

Source
pub fn normalize_user_geo(
    attributes: &mut Annotated<Attributes>,
    info: impl FnOnce(IpAddr) -> Option<Geo>,
)
Expand description

Normalizes the user’s geographical information into [Attributes].

Does not modify the attributes if there is already user geo information present, to preserve original values.

This uses the [CLIENT_ADDRESS] attribute to infer the client IP address, you may want to run normalize_client_address before normalize_user_geo.