SiteFilterService

Publishers may not wish to display certain ads, such as their competitors' ads, on their website. SiteFilterService lets you specify site filters to identify such sites. Ads that link to sites on the filter list will not appear on the publishers' content pages.

Adding Site Filters to a Website

To add a site filter, use the addSiteFilters operation, specifying synServiceId with a list of website URLs you want to filter out. The operation setSiteFilters is similar but clears the filter list before adding the specified sites. Similarly, you can remove specific sites from the list.

Note that by entering a top level domain such as www.example.com, publishers will block all ads that link to subdirectories below that domain. The following rules apply to the competitive ad filter:

The version 2 WSDL for this service is at https://www.google.com/api/adsense/v2/SiteFilterService?wsdl.

The version 3 WSDL for this service is at https://www.google.com/api/adsense/v3/SiteFilterService?wsdl.

Requests

addSiteFilters

Adds a collection of site filters for a syndication service.

Parameters

Parameter nameParameter typeParameter description
synServiceId string
the syndication service ID
siteFilters string[]
a collection of URLs that should be filtered

Response

Response typeResponse description
(none)

Errors

Error numberError description
201 if synServiceId is not valid
601 before adding any site filters if an element of siteFilters is malformed
602 if siteFilters is empty
603 before adding any site filters if there are duplicate filters in siteFilters
605 before adding any site filters if a filter in siteFilters is already active
606 before adding any site filters if adding all the specified filters would exceed the site filter limit

getSiteFilters

Gets the site filters for a syndication service.

Parameters

Parameter nameParameter typeParameter description
synServiceId string
the ID of the syndication service

Response

Response typeResponse description
string[] the collection of site filters associated with the service ID

Errors

Error numberError description
201 if synServiceId is not valid

removeSiteFilters

Removes a collection of site filters from a syndication service.

Parameters

Parameter nameParameter typeParameter description
synServiceId string
the syndication service ID
siteFilters string[]
a collection of URLs that should no longer be filtered

Response

Response typeResponse description
(none)

Errors

Error numberError description
201 if synServiceId is not valid
601 before deleting any site filters if an element of siteFilters is malformed
602 if siteFilters is empty
603 before deleting any site filters if there are duplicate filters in siteFilters
604 before deleting any site filters if a filter in siteFilters is not a current site filter

setSiteFilters

Sets the site filters for a syndication service.

Parameters

Parameter nameParameter typeParameter description
synServiceId string
the ID of the syndication service
siteFilters string[]
a collection of URLs that should be filtered

Response

Response typeResponse description
(none)

Errors

Error numberError description
201 if synServiceId is not valid
601 before setting any site filters if an element of siteFilters is malformed
603 before setting any site filters if there are duplicate filters in siteFilters
606 before setting any site filters if setting all the specified filters would exceed the site filter limit