Use location data to show a weblayer to a specific audience, such as visitors from the United Kingdom. You can target a country, state, city, or another location value available in your project.
The best approach depends on where your location data is available:
-
Session start events: Use the location data tracked in
session_startevents. - Customer attributes: Use a location stored on the customer profile.
- Enhanced web targeting: Use a location value available
- Geo Analyses: Explore customer activity on a map and select a specific area to target.
Target profiles with session start events
Use this approach when your project tracks location data in session_start events. These system events are available by default and include attributes such as city, state, and country. Read the session start event documentation for the complete list of available attributes.
Match at least one session start event
In the weblayer audience settings, add a Customer filter that matches a session_start event with the required location. For example, to target visitors from the United Kingdom, set the country attribute to United Kingdom.
The filter matches profiles with at least one tracked session_start event that has this value. The available values depend on the data tracked in your project. Check the event data before you configure the filter.
Match the most common location
Use the most common aggregate when you want to target profiles whose most frequently recorded location matches your chosen value. For example, you can target profiles whose most common country value is United Kingdom.
You can also use another session_start attribute, such as city or state, when it better matches your use case. You can combine this condition with other audience conditions to create a more specific audience.
Target profiles with customer attributes
Use a customer attribute when your project stores a location directly on the customer profile. For example, you might store a customer’s country, state, or city as an attribute. In the weblayer audience settings, add a Customer filter that matches the relevant attribute and value. For example:
- Attribute:
country - Value:
UK
You can add multiple conditions to create a more specific audience. For example, combine a country and city condition to target customers in a particular area. The available attributes and values depend on your project configuration. Select the attribute that most accurately represents the location you want to target.
Target visitors with enhanced web targeting
Use enhanced web targeting when the location is available on the current web page or in the browser. When JavaScript SDK evaluates the weblayer, it checks the configured page variables and compares their current values with your targeting conditions. You can use one of the following variable types:
- URL parameter
- DataLayer variable
- JavaScript variable
- Custom JavaScript
For example, you can create a custom JavaScript variable that returns a visitor’s country and configure the weblayer to show when the value is UK.
Consider the implementation requirements
Enhanced web targeting can evaluate a visitor as they browse the page, including a new visitor without historical profile data. The page must provide the required location value when the SDK evaluates the weblayer. This approach requires technical implementation on your website. A developer or another technical person familiar with your website’s JavaScript or dataLayer should configure the page variables. To set up the variables, go to Project settings > Campaigns > General > Page variables. Then, use the variables in the weblayer’s Show on pages with variables settings. For more information, read Enhanced web targeting.
Target a geographical area with Geo Analyses
Use Geo Analyses to explore the geographical distribution of customer activity before creating an audience. Geo Analyses uses location data from customer activity and displays it on a map. You can use different location presets, including:
-
First session: Uses the first
session_startevent for each customer. -
Last session: Uses the most recent
session_startevent for each customer. - All sessions: Counts each session as an individual occurrence.
- Custom: Uses an event attribute or customer attribute that you define.
To create a customer selection from the map:
- Go to Analyses > Geo Analyses.
- Create and configure a Geo Analysis.
- Hold Shift and select an area on the map.
- Select Show customers to open the customer list with the corresponding filters.
This method can help you target a specific area within a country, such as a metropolitan area. The accuracy depends on the location data available in your project.
Choose the approach that fits your data
The options above are examples. The right solution depends on how your project tracks location data and whether you need to target known profiles, new visitors, or a specific geographic area on a map. Before configuring the weblayer, confirm:
- Which location attributes are available in your project.
- Whether the data is tracked in events, customer attributes, or page variables.
- Whether you need to target existing profiles, new visitors, or both.
- How precise the location must be, such as country, state, city, or metropolitan area.
Different approaches can achieve the same result. Choose the one that best matches your data and implementation resources.