1. Trang chủ
  2. » Luận Văn - Báo Cáo

AFS creating a test page for AFS CSA

4 10 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Nội dung

Externally Shareable Creating a test page for AFS CSA Background In order to apply for AdSense for Search Custom search ads (CSA), pa�ners will have to prepare a test page with CSA implemented This. Mua tài liệu này nhé bạn

Background: In order to apply for AdSense for Search Custom search ads (CSA), partners will have to prepare a test page with CSA implemented This is to ensure that the implementations are policy compliant and that any potential risks can be proactively mitigated before partners are penalized for the violations Please take a look at the below guide to implement CSA on your test page Requirements: ● ● A test page with organic search results that is accessible by Google representative and that resembles the page where you plan to place CSA Have read the CSA policies and ASQ policies Implementation guide: Step 1: In the section, insert: (function(g,o){g[o]=g[o]||function(){(g[o]['q']=g[o]['q']||[]).push( arguments)},g[o]['t']=1*new Date})(window,'_googCsa'); Step 2: In the section, insert: var pageOptions = { "pubId": "pub-9616389000213823", "styleId": "5290249905", "query": "" // Make sure the correct query is placed here! }; var adblock1 = { "container": "afscontainer1" }; _googCsa('ads', pageOptions, adblock1); ! pub-9616389000213823 is a test account so you will not earn any revenue from the resulting impressions/clicks Step 3: AFS returns ads based on queries users search for on your site You must place the user’s search query as the query value in the code snippet before ads can be returned ! The query value must be exactly the query entered by the user Adding to or editing this value before sending an AFS ad request is a policy violation There are several ways you can set this value You can hardcode this value with backend code, set it to a JavaScript variable which holds the user’s search query, or pull the value straight from the search input element on the page In the code snippet below, the value is pulled from the search input element: var searchQuery = document.getElementById('userSearchInput').value; var pageOptions = { "pubId": "pub-9616389000213823", "styleId": "5577094643", "query": searchQuery }; Step 4: Where you want the ads show, insert: If you plan to have multiple ad containers (e.g one at the top of the search results and one at the bottom of the search results), you must create an additional adblock element and add the associated ad container as below: var pageOptions = { "pubId": "pub-9616389000213823", "styleId": "32384626433", "query": "" // Make sure the correct query is placed here! }; var adblock1 = { "container": "afscontainer1" }; var adblock2 = { "container": "afscontainer2" }; _googCsa('ads', pageOptions, adblock1, adblock2); ! adblock must match the name of the variable and the container value must match the div ID Step 5: Now ads should be serving on your site If there are no ads being served on your site, please make sure that the query parameter is correctly populating the search keywords (Step 3) If it is, then try using other popular keywords such as “flowers” or “sofa” If you’re able to confirm that the ads are being served on the page, please send the URL to the Google representative The test page should look as below: ... "container": "afscontainer1" }; var adblock2 = { "container": "afscontainer2" }; _googCsa('ads', pageOptions, adblock1, adblock2); ! adblock must match the name of the variable and the... results), you must create an additional adblock element and add the associated ad container as below: ... Adding to or editing this value before sending an AFS ad request is a policy violation There are several ways you can set this value You can hardcode this value with backend code, set it to a

Ngày đăng: 14/10/2022, 16:16

w