---
sourceDocument: Xanadu Platform Analytics
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/now-intelligence

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu Platform Analytics

ft:clusterId :

    - par

bundleId :

    - par

workflow :

    - Platform


---

# Define how to detect your user's location

# Define how to detect your user's location {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

Detect your users by selecting and prioritizing a detection policy. You can also define the order in which these policies apply. There are predefined detection policies, but you can create custom scripts to give more
flexibility to your definitions.

## Before you begin

Role required: analytics_admin

## About this task

There are four methods by which you can detect a user's location. Prioritize the method by using the Order field and select if the policy should be active or not.  
Note:  
If a detection provider isn't active or a script doesn't return a response, the system default policy of Explicit Opt-in is implemented.
The available detection policy providers are:

User country
:   Uses the Country code \[country\] column stored in the User table \[sys_user\].

Country Customer script
:   A custom script that can be loaded onto the ServiceNow Platform to determine the user's location and returns the country's ISO 3166-2 code.  
    Note:  
    If a customer script is defined but the Active field isn't selected, the next priority in the Order table will be activated.

Policy Customer Script
:   A custom script that can be loaded onto the ServiceNow Platform to determine the user's consent policy and return one of the policy names from the User Experience Analytics Consent Policy table \[sys_analytics_detection_policy_provider\].  
    Note:  
    If a customer script is defined but the Active field isn't selected, the next priority in the Order table is activated.

GeoIP
:   An IP-based detection provider that identifies a user's geographical location using an internal service. This provider is the default option if no detection policies are selected.

## Procedure

1. Navigate to AllUser Experience AnalyticsDetection Policy Providers.  
   The User Experience Analytics Detection Policy Providers page displays.
2. Select any of the detection policy providers to update its Active status and change the order in which the policy is enforced.  
   Note:  
   To enforce a policy, it must be active.
3. **Optional:** Select either Country Customer Script or Policy Customer Script and enter a script to determine either the user's location or the user's consent policy, and to return a value.  
   Note:  
   You can use the system property glide.analytics.consent.script_timeout to define the run time of the script. For more information, see [User Experience Analytics related properties](https://servicenow-prod.fluidtopics.net/Lga9YQBqGGt0xfB_HeNE0w "Use system properties to configure User Experience Analytics in Platform Analytics, ServiceNow Mobile Platform, Service Portal, and the Conversational Analytics area of Virtual Agent.").  
   For more information on using scripts, see [JavaScript syntax editor](https://www.servicenow.com/docs/access?context=c_SyntaxEditor&version=xanadu&pubname=xanadu-application-development&ft:locale=en-US).
* **[Viewing and updating User Experience Analytics consent tracking policies for individual countries](https://servicenow-prod.fluidtopics.net/ORy1KB4fgjMaVGpXU9YfzQ)**   
  View the consent tracking policy for all countries or select a country to update its existing policy.

*[\>]: and then


