[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-28 UTC."],[[["\u003cp\u003eRetrieves the AdSense code (previously known as 'auto ad code') for a specified ad client.\u003c/p\u003e\n"],["\u003cp\u003eThis functionality is exclusively available for ad clients possessing a productCode of AFC.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides AdSense code snippets for both HTML and AMP pages, including designated head and body placements for AMP.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with specific Google Adsense scopes for access.\u003c/p\u003e\n"]]],["To retrieve the AdSense code for an ad client, a `GET` request is sent to `https://adsense.googleapis.com/v2/{name}/adcode`, where `name` specifies the ad client's ID. The request body must be empty. The response, containing strings representing the AdSense code, `ampHead` and `ampBody`, is returned. It requires authorization with either `adsense` or `adsense.readonly` scopes and only works for ad clients with a product code of AFC.\n"],null,["# Method: accounts.adclients.getAdcode\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.AdClientAdCode.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nGets the AdSense code for a given ad client. This returns what was previously known as the 'auto ad code'.\n\nThis is only supported for ad clients with a productCode of AFC.\n\nFor more information, see [About the AdSense code](https://support.google.com/adsense/answer/9274634).\n\n### HTTP request\n\n`GET https://adsense.googleapis.com/v2/{name=accounts/*/adclients/*}/adcode`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Name of the ad client for which to get the adcode. Format: accounts/{account}/adclients/{adclient} |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nRepresentation of the AdSense code for a given ad client.\n\nFor more information, see [About the AdSense code](https://support.google.com/adsense/answer/9274634).\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------|\n| ``` { \"adCode\": string, \"ampHead\": string, \"ampBody\": string } ``` |\n\n| Fields ||\n|-----------|------------------------------------------------------------------------------------|\n| `adCode` | `string` Output only. The AdSense code snippet to add to the head of an HTML page. |\n| `ampHead` | `string` Output only. The AdSense code snippet to add to the head of an AMP page. |\n| `ampBody` | `string` Output only. The AdSense code snippet to add to the body of an AMP page. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/adsense`\n- `\n https://www.googleapis.com/auth/adsense.readonly`"]]