@location

Description

The @location context query describes information about where the user viewing the current ad is located. Use this context query to have your ad respond to the current DMA, city, region, country, etc.

Example Usage

For example, you wanted to use a contextually relevant background image depending on what city the user is currently located in. You could use the city and region contexts to do just that.

.component {
	/* Default */
	background-image: url(/assets/generic-skyline.jpg);
	
	/* Chicago */
	@location (city: chicago) and (region: il) {
		background-image: url(/assets/chicago-skyline.jpg);
	} 
	
	/* New York */
	@location (city: new_york) and (region: ny) {
		background-image: url(/assets/ny-skyline.jpg);
	}
	
	/* Los Angeles */
	@location (city: los_angeles) and (region: ca) {
		background-image: url(/assets/la-skyline.jpg);
	}
}

Available Features

Feature NameJavascript NameValueExample ValueDescription
citylocationCitystringchicagoThe name of the city where the request is coming from. All lower-case, spaces should be replaced by an underscore (e.g. new_york).
regionlocationRegionstringilThe two letter abbreviation of the state or region where the request is coming from.
country-codelocationCountryCodenumberusThe ISO Alpha-2 Code of the country where the request is coming from. Please see full list here.
dmalocationDmanumber602The DMA code of the geographical market where the request is coming from. Please see full list here.
latitudelocationLatitudenumber41.878114The latitude of the location where the request is coming from.
longitudelocationLongitudenumber-87.629798The longitude of the location where the request is coming from.