Adds a web page criteria to target Dynamic Search Ads.
498613
private static function addWebPageCriteria(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        AdGroup $adGroup
    ) {
        $adGroupCriterionService = $adWordsServices->get($session, AdGroupCriterionService::class);

        // Create a webpage criterion for special offers.
        $param = new WebpageParameter();
        $param->setCriterionName('Special offers');

        // Create a webpage criterion for special offers.
        $urlCondition = new WebpageCondition();
        $urlCondition->setOperand(WebpageConditionOperand::URL);
        $urlCondition->setArgument('/specialoffers');

        $titleCondition = new WebpageCondition();
        $titleCondition->setOperand(WebpageConditionOperand::PAGE_TITLE);
        $titleCondition->setArgument('Special Offer');

        $param->setConditions([$urlCondition, $titleCondition]);

        $webpage = new Webpage();
        $webpage->setParameter($param);

        // Create a biddable ad group criterion.
        $biddableAdGroupCriterion = new BiddableAdGroupCriterion();
        $biddableAdGroupCriterion->setAdGroupId($adGroup->getId());
        $biddableAdGroupCriterion->setCriterion($webpage);
        $biddableAdGroupCriterion->setUserStatus(UserStatus::PAUSED);

        // Set a custom bid for this criterion.
        $biddingStrategyConfiguration = new BiddingStrategyConfiguration();

        // Optional: set a custom bid.
        $cpcBid = new CpcBid();
        $money = new Money();
        $money->setMicroAmount(10000000);
        $cpcBid->setBid($money);
        $biddingStrategyConfiguration->setBids([$cpcBid]);
        $biddableAdGroupCriterion->setBiddingStrategyConfiguration(
            $biddingStrategyConfiguration
        );

        $operation = new AdGroupCriterionOperation();
        $operation->setOperand($biddableAdGroupCriterion);
        $operation->setOperator(Operator::ADD);

        // Create the criterion on the server and print out some information.
        $result = $adGroupCriterionService->mutate([$operation]);
        $adGroupCriterion = $result->getValue()[0];
        printf(
            "Web page criterion with ID %d was added to ad group ID %d.\n",
            $adGroupCriterion->getCriterion()->getId(),
            $adGroupCriterion->getAdGroupId()
        );
    }
774079
public I addPage(WebPage webPage) {
        beforeAddPageEvent(webPage);
        urls.put(baseUrl + webPage.constructName(), webPage);
        return getThis();
    }
877611
@Override
    public T addAsWebInfResource(final URL resource, final String target) throws IllegalArgumentException {
        Validate.notNull(resource, "Resource should be specified");
        Validate.notNullOrEmpty(target, "Target should be specified");

        return addAsWebInfResource(new UrlAsset(resource), target);
    }
375076
function ads(query){
  var params = parse(query);
  for (var key in params) {
    for (var id in QUERYIDS) {
      if (key === id) {
        return {
          id : params[key],
          type : QUERYIDS[id]
        };
      }
    }
  }
}
975503
function _checkForDynamicPage(uri, { _dynamic }) {
  if (!_dynamic || typeof _dynamic !== 'boolean') {
    return bluebird.reject(new Error('Page is not dynamic and requires a url'));
  }

  return bluebird.resolve(_dynamic);
}
1339944
public void addSearchIndexSource(CmsSearchIndexSource searchIndexSource) {

        m_indexSources.put(searchIndexSource.getName(), searchIndexSource);

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_SEARCH_INDEX_SOURCE_2,
                    searchIndexSource.getName(),
                    searchIndexSource.getIndexerClassName()));
        }
    }
988835
def ad_param(criterion, index = nil, text = nil, &block)
      ad_param = AdParam.new(self, criterion, index, text, &block)
      ad_param.save unless inside_initialize? or criterion.inside_initialize?
      @ad_params ||= []
      @ad_params.push( ad_param )
      ad_param
    end
1193962
private static function setCampaignTargetingCriteria(
        $campaignId,
        AdWordsServices $adWordsServices,
        AdWordsSession $session
    ) {
        $campaignCriterionService = $adWordsServices->get($session, CampaignCriterionService::class);

        $campaignCriteria = [];
        // Create locations. The IDs can be found in the documentation or retrieved
        // with the LocationCriterionService.
        $california = new Location();
        $california->setId(21137);
        $campaignCriteria[] = new CampaignCriterion($campaignId, null, $california);

        $mexico = new Location();
        $mexico->setId(2484);
        $campaignCriteria[] = new CampaignCriterion($campaignId, null, $mexico);

        // Create languages. The IDs can be found in the documentation or retrieved
        // with the ConstantDataService.
        $english = new Language();
        $english->setId(1000);
        $campaignCriteria[] = new CampaignCriterion($campaignId, null, $english);

        $spanish = new Language();
        $spanish->setId(1003);
        $campaignCriteria[] = new CampaignCriterion($campaignId, null, $spanish);

        // Create operations to add each of the criteria above.
        $operations = [];
        foreach ($campaignCriteria as $campaignCriterion) {
            $operation = new CampaignCriterionOperation();
            $operation->setOperand($campaignCriterion);
            $operation->setOperator(Operator::ADD);
            $operations[] = $operation;
        }

        // Set the campaign targets.
        $result = $campaignCriterionService->mutate($operations);

        // Display added campaign targets.
        foreach ($result->getValue() as $campaignCriterion) {
            printf(
                "Campaign criterion of type '%s' and ID %d was added.\n",
                $campaignCriterion->getCriterion()->getType(),
                $campaignCriterion->getCriterion()->getId()
            );
        }
    }
1115707
function searchBar_checkSearchResultPage(searchTerm) {
    // Retrieve the URL which is used for the currently selected search engine
    var targetUrl = this._bss.currentEngine.getSubmission(searchTerm, null).uri;
    var currentUrl = this._controller.tabs.activeTabWindow.document.location.href;

    // Check if pure domain names are identical
    var domainName = targetUrl.host.replace(/.+\.(\w+)\.\w+$/gi, "$1");
    var index = currentUrl.indexOf(domainName);

    this._controller.assertJS("subject.URLContainsDomain == true",
                              {URLContainsDomain: currentUrl.indexOf(domainName) != -1});

    // Check if search term is listed in URL
    this._controller.assertJS("subject.URLContainsText == true",
                              {URLContainsText: currentUrl.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1});
  }
931705
def add(self, adgroup_id, keyword_prices, nick=None):
        ''''''
        request = TOPRequest('xxxxx.xxxxx.keywords.add')
        request['adgroup_id'] = adgroup_id
        request['keyword_prices'] = keyword_prices
        if nick!=None: request['nick'] = nick
        self.create(self.execute(request), models = {'result':Keyword})
        return self.result
880410
public void registerSearchReplace(Button search, Button replace) {

        if (getState().m_enableSearchReplace) {
            throw new RuntimeException("Search/replace already registered.");
        }
        search.setId(HTML_ID_PREFIX + m_componentId + "-search");
        replace.setId(HTML_ID_PREFIX + m_componentId + "-replace");
        getState().m_enableSearchReplace = true;
        markAsDirty();
    }
1238923
def search_browser(self, text):
    """"""
    self.impl.get(self.base_url)

    search_div = self.impl.find_element_by_id("search")
    search_term = search_div.find_element_by_id("term")
    search_term.send_keys(text)
    search_div.find_element_by_id("submit").click()
    e = self.impl.find_element_by_css_selector("table.list tr td a")
    return e.get_attribute("href")
837448
def AttachUserList(client, ad_group_id, user_list_id):
  
  ad_group_criterion_service = client.GetService(
      'AdGroupCriterionService', 'v201809')

  user_list = {
      'xsi_type': 'CriterionUserList',
      'userListId': user_list_id
  }

  ad_group_criterion = {
      'xsi_type': 'BiddableAdGroupCriterion',
      'criterion': user_list,
      'adGroupId': ad_group_id
  }

  operations = [{
      'operator': 'ADD',
      'operand': ad_group_criterion
  }]

  return ad_group_criterion_service.mutate(operations)['value'][0]
443691
def add_html_link(app, pagename, templatename, context, doctree):
    """"""
    app.sitemap_links.append(pagename + ".html")
824160
def targeting_criteria(self, id=None, **kwargs):
        
        self._validate_loaded()
        if id is None:
            return TargetingCriteria.all(self.account, self.id, **kwargs)
        else:
            return TargetingCriteria.load(self.account, id, **kwargs)
967060
private void setRequestProps(WbGetEntitiesActionData properties) {
		StringBuilder builder = new StringBuilder();
		builder.append("info|datatype");
		if (!this.filter.excludeAllLanguages()) {
			builder.append("|labels|aliases|descriptions");
		}
		if (!this.filter.excludeAllProperties()) {
			builder.append("|claims");
		}
		if (!this.filter.excludeAllSiteLinks()) {
			builder.append("|sitelinks");
		}

		properties.props = builder.toString();
	}
804498
private function addPagination(Search $search, $pageSize, $page, $limit)
    {
        $offset = 0;
        if ($pageSize) {
            $pageSize = intval($pageSize);
            $offset = ($page - 1) * $pageSize;
        }

        if (null === $limit) {
            $limit = $this->defaultLimit;
        }

        if (null === $pageSize || $offset + $pageSize > $limit) {
            $pageSize = $limit - $offset;

            if ($pageSize < 0) {
                $pageSize = 0;
            }
        }

        $search->setFrom($offset);
        $search->setSize($pageSize);
    }