Help Center Manage Your Account Ad Targeting using Restrictions
Geolocation API
Geolocation API of HTML5 can be used to provide accurate latitude and longitude values for ad serving. By default, our ad server maps an IP address to the physical location for geotargeting. However, IP-based mapping has its limitations. Accuracy is very high at the country level but can be less accurate at the city level, depending on the country and data coverage. This is because of several factors: IP addresses are assigned and moved from one location to another location frequently by their Internet service providers. Also, many users behind a web proxy can share the same public IP address. Geolocation API can also solve the issue with image proxy servers in email ad serving.Geolocation API solves this problem by gathering additional information, including surrounding Wi-Fi networks. Visitors allow only trusted websites to know their geographical locations and the visitor needs to explicitly allow his/her location to be disclosed. Your location-aware website would get this information from the visitor's browser and append it to the ad tag and it will be used instead of the visitor's IP address. In order to use this feature, you must obtain explicit consent from the viewer before getting his/her coordinate data.
HTML and JavaScript
Here is a simple example to get the latitude and longitude value using Geolocation API.<script type="text/javascript"> function getLocation() { if (navigator.geolocation) { // detection navigator.geolocation.getCurrentPosition(function(pos) { alert(pos.coords.latitude); alert(pos.coords.longitude); }); } else { // Geolocation API not available } }
Ad Tag Parameters
To enable geolocation in the ad serving tag, set the latitude value with parameter "aslat", longitude value with parameter "aslong", and a token with parameter "asgeo". A token is required when appending the latitude and longitude value into the serving code. Please contact us to request this token for your account and to agree to obtain user's consent on your end.Examples
Here is a request for a visitor in San Jose:/ad.php?do....&aslat=37.339386&aslong=-121.894955&asgeo=[TOKEN]Here is a request for a visitor in Atlanta:
/ad.php?do....&aslat=33.748995&aslong=-84.387982&asgeo=[TOKEN]
Other Articles in Ad Targeting using Restrictions
Learn about ad targeting and restrictions ad serving such as frequency capping, geo-targeting, quota, roadblock, flight date, etc.
- Ad Budget and Ad Rates
- Audience Session Targeting
- Companion & Competitive Positioning
- Dayparting
- Frequency Capping
- Maximum/Target Quotas
- Proactive Targeting and Passive Restriction
- Restriction Status Notification
- Restrictions for an ad, zone, campaign or group
- Schedule Settings for Restriction
- Share of Voice - Share of Impression
- Start/End Date
- Target ads by placement URL or referring URL
- Target ads by visitor city, group of cities or within a radius
- Target ads by visitor country
- Target ads by visitor language
- Target Keywords
- Time Capping
- Visitor IP Address
- Wizard for setting up restrictions
Cannot find an answer for your question? Ask our Customer Care team
Related
- Email Ad Serving
"You can manage and display advertising in email messages and newsletters with AdSpeed's email ad server. Pricing Email ad serving ..."
- Target ads by visitor city, group of cities or within a radius
"You can limit ad serving to visitors from a specific city, a group of cities, or within a radius of ..."
- What are custom ad serving settings and variables?
"These are additional settings available to the serving code for advanced functionality. Custom Parameters You can enter one of the ..."
- Ad Targeting
"When you create a new ad, it has no restriction and therefore can be shown to anyone, anywhere, anytime. However, ..."
- Website
"Documentation for API methods to manage one or multiple websites. API Version1.4.6 (build 20240530). This page was updated on Thu, ..."