Custom Search Ads parameter descriptions - shahzade baujiti

Breaking

Wednesday, January 30, 2019

Custom Search Ads parameter descriptions

Custom Search Ads parameter descriptions

For advanced users we've provided this list of the currently supported custom search style parameters. The code you generate in AdSense contains all of the most commonly used parameter settings. There are two required parameters: pubId and query. AdSense provides the pubId but you must edit the code and pass a value for the query parameter. All of the other parameters are optional and are described below.

Parameter types

There are two types of parameters:
Here's some example output from the code generator with two ad blocks. To configure this code, you must set the required query parameter in the pageOptions map (e.g. “query”: myQuery). This is all that’s required to start showing ads. You can also set optional page level parameters in the page level block and individual unit level parameters in the adblock1 and adblock2 maps.
<div id="afscontainer1"></div>
<div id="afscontainer2"></div>

<script type="text/javascript" charset="utf-8">

  // Page level parameters
  var pageOptions = {
    "pubId": "partner-pub-1234567891234567",
    "styleId": "1234567890",
    "query": myQuery,
  };

  // Unit level parameters
  var adblock1 = {
    "container": "afscontainer1",
  };

  var adblock2 = {
    "container": "afscontainer1",
  };

  _googCsa('ads', pageOptions, adblock1, adblock2);

</script>

Page level parameter descriptions

These parameters only need to be specified once per page. They affect all units on the page.

Required

ParameterDescription and examples
pubIdRequired
This is your AdSense client-ID. Your pubId is the part of your client-ID that comes after 'partner-'. For example, if your client-ID is 'partner-test-property', your pubId is 'test-property'. This is standard protocol for CSA.
Example:
'pubId' : 'test-property'
queryRequired
This is the search query entered by the user. The value of the query parameter should be unencoded.
Examples:
‘query’ : ‘flowers'
'query' : 'black & decker'
'query' : myQuery // where myQuery is a JavaScript variable containing the search query

Optional configuration settings

ParameterDescription and examples
adPageOptional
The adPage parameter specifies the results page ads are being displayed on. This parameter is used when users navigate past the first page of search results. For example, if five ads are requested, and the adPageparameter is set to '2', the returned ads will be the second page of five ads.
adsafeOptional
Specifies the filtering rules that Google should apply to ads matching the search query. The following are the valid settings for adsafe and the effect each value has on returned ads.
  • 'high' Returns family-safe ads. Does not return non-family-safe or adult sexual content ads.
  • 'medium' Returns family-safe and non-family-safe ads. Doesn't return adult sexual content ads.
  • 'low' Returns all types of ads.
By default adsafe is set to 'high'.
Example:
'adsafe': 'medium'
adtestOptional
The adtest parameter is used to indicate that a request for ads is a test. When the adtest parameter has a value of 'on', Google treats the request as a test and does not count the ad impressions or track the clickthrough results.
When the adtest parameter has a value of 'on', you do not generate any revenue.
Use this parameter when testing, but do not use it in production systems or you will not be paid for ads that you display.
The default adtest value is 'off'.
Example:
'adtest' : 'on'
channelOptional
You may include an AdSense for Search channel for tracking the performance of different pages. Use the unique channel ID you created in your AdSense account. Learn more about tracking ad performance with custom channels.

Multiple channels should be separated by the '+' symbol.
 
Examples:
'channel' : 'testA' 'channel' : 'testA+testB'
hlOptional
This parameter identifies the language that the requested ads should target. The default value is 'en'.
Google supports all Google Ads API language codes.
Advertisers specify the languages that their ads target. If you include this parameter in your request, Google only returns ads that are targeted for that language or targeted for all languages but it does not guarantee that the ad text will be in the specified language.
Typically, you should set the hl parameter to the primary language of the page from which this parameter is sent.
Examples:
'hl' : 'es'
ieOptional
The ie parameter sets the character encoding scheme that should be used to interpret the query string.
The default ie value is 'utf-8'.
ValueStandard nameAssociated supported languages
latin1ISO-8859-1Western European (Catalan, Danish, Dutch, English, Finnish, French, German, Indonesian, Italian, Norwegian, Portuguese, Spanish, Swedish)
latin2ISO-8859-2Eastern European (Croatian, Czech, Hungarian, Polish, Romanian, Serbian, Slovak, Slovenian)
latin3ISO-8859-3 
latin4ISO-8859-4Baltic (Estonian, Latvian, Lithuanian)
cyrillicISO-8859-5Bulgarian, Russian
arabicISO-8859-6 
greekISO-8859-7Greek
hebrewISO-8859-8Hebrew
latin5ISO-8859-9 
latin6ISO-8859-10Icelandic
euc-jpEUC-JPJapanese
euc-krEUC-KRKorean
sjisShift_JISJapanese
big5Big5Traditional Chinese
gbGB2312Simplified Chinese
utf-8UTF-8All
oeOptional
The oe parameter sets the character encoding scheme that Google should use to encode the text of the ads. While technically optional, it's good practice to pass a value for this parameter.
The default oe value is 'utf-8'. Refer to the ie parameter for the full list of possible values.
Personalised adsOptional
Specifies whether users have consented to allowing the publisher to share personal information with Google for the purpose of personalised advertising.
  • true Returns query targeted ads and some ads that may be targeted with the user's Google cookies. If the user is located in the European Union, the user must first consent to allowing your site to share personal information with Google for the purpose of personalised advertising.
  • false Returns only query targeted ads. This will not return any ads that are targeted with the user's Google cookies. If a user has declined consent for allowing your site to share personal information with Google for the purpose of personalised advertising, you must set this value to false.
By default personalisedAds is set to 'true'.
Example:
personalisedAds: false,

Unit level parameter descriptions

These parameters affect the way that individual ad units on a page are presented to the user; each parameter can be set individually for each ad unit.

Required

ParameterDescription and examples
containerRequired
The id of the empty ad container <div id='afscontainer1'></div>where the ad should appear.
Example:
'container' : 'afscontainer1'

Optional configuration settings

ParameterDescription and examples
maxTopOptional
Use this parameter to specify the number of ads to be shown on the top ad unit.
This parameter is used in place of the number parameter. This ad unit should be wide enough so the first line of the ads doesn't wrap. Using the maxTop parameter on any other placement on the page is a policy violation.
Example:
'maxTop' : 4
numberOptional
The number of ads which should appear in this unit. The default value is '2'.
Example:
'number' : 4
widthRequired
Specifies the width of the ad unit in pixels.
Example:
width:600px !

No comments:

Post a Comment