In case you would like to show weblayer to only a specific subset of your audience, you can use the geolocation to filter only profiles that are coming from a particular region. Imagine you have a website with visitors from the UK, the USA, and Germany, and you would like to display the weblayer only to visitors or customers from the UK. There are multiple approaches to achieve this using events, attributes, or enhanced web targeting. The geolocation can be a city, state, country, or any other identifier of the region you want to target.
Targeting using session_start events
If you are tracking session_start events in your project, they typically contain default properties such as city, state, and country, which you can use for targeting profiles. The values you can use in filtering always depend on what values you are tracking for the session_start events in a particular project. In the weblayer audience filter, you can select the customer filter to filter out profiles that have a session start event matching your desired country, for example.
It will filter out profiles that have at least one session_start event tracked with the country United Kingdom.
Alternatively, you can use the "most common" aggregate to filter out profiles that are mostly visiting from the UK.
You can use any attribute from the session_start events that suits your use case and use it to filter out profiles that should be eligible to see the weblayer. You can also add multiple other conditions or combine various values. The flexibility will depend on your goal.
Targeting using customer attributes
If you are tracking a country as a customer attribute or have any other location attribute in your project, you can also use it in the audience filtering. Again, it all depends on what values you are tracking in your project. Below is an example of how it could look for the UK audience.
In this case, you can also choose multiple conditions, adjust them according to your specific use case, and be more granular, such as selecting a city. The options are always dependent on the values available in your project, and which values best represent your geo restriction.
Targeting using Enhanced Web Targeting
For targeting, you can use our Enhanced Web Targeting. When the weblayer is being evaluated, the JS SDK looks for specific conditions related to the webpage variables, like URL parameters or dataLayer. It checks if these conditions match the values of those variables at that moment. You can create a JavaScript condition on a website that you would build around the geolocation, and you can evaluate if it matches, for example, the UK.
Enhanced Web Targeting would be the quickest solution, as it would evaluate visitors, including entirely new ones, while they browse the page and show them the weblayer instantly. However, it requires prior knowledge of JavaScript code, and you will need to implement it on your website, along with your project's Page Variables. This solution would be the most complex one and would require more time to implement.
Targeting using Geo Analyses
Another option for targeting a specific area or region is to use our Geo Analyses feature, which analyzes data from session start events. The feature plots your customer's activities on a world map. The resulting chart provides insights into the geographical distribution of your customers' activities, and you can use it later to create a customer filter that you can apply to the audience filter of the weblayer. It can be helpful to select a precise location within a country, for example, the London Metropolitan Area. The results of Geo Analyses will always depend on the data that you are tracking in session start events.
Note
The solutions above are just examples of how to achieve geo restrictions; the final solution would always require assessing your tracked data and possibilities to choose what suits your specific use case best. There can be more solutions that could achieve the same goal. The illustrations above serve as examples of how to implement the geolocation condition inside the weblayer settings.