البدء
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
هذا المستند مخصّص للمطوّرين الذين يريدون استخدام AdSense Management API للحصول على معلومات حول حساباتهم على AdSense. يفترض هذا المستند أنك على دراية
بمفاهيم برمجة الويب وتنسيقات بيانات الويب.
قبل البدء
الحصول على حساب في AdSense
اشترِك أو سجّل الدخول إلى حسابك على
AdSense للبدء.
التعرّف على AdSense
إذا لم تكن تعرف مفاهيم AdSense، يُرجى الاطّلاع على المعلومات التمهيدية حول AdSense
وتجربة واجهة مستخدم AdSense
قبل البدء في الترميز.
اختيار مكتبة البرامج
في صفحة "مكتبات العميل وعيّناته"، ستعثر على معلومات عن المكتبات والنماذج المتوفّرة. انقر فوق علامة التبويب الخاصة باللغة التي اخترتها واتبع الروابط لتنزيل المصدر.
تتولى مكتبات العملاء معالجة ما يلي بالنيابة عنك:
- مصادقة
- اكتشاف الخدمات
- إنشاء الطلبات إلى واجهة برمجة التطبيقات
- تحليل الردود
اقرأ التعليمات لتثبيت مكتبة البرامج التي اخترتها وضبطها، والتي يمكنك العثور عليها عادةً في ملف README في الدليل الجذري للمستودع.
إذا كانت لعملية التنفيذ احتياجات خاصة، مثل استخدام لغة غير متاحة، يمكنك تقديم طلبات
مباشرة إلى واجهة برمجة التطبيقات بدلاً من استخدام مكتبة عميل.
تسجيل تطبيقك
لاستخدام واجهة برمجة تطبيقات AdSense Management، يجب تسجيل التطبيق الذي تُطوّره
عن طريق إنشاء مشروع وإنشاء معرِّف عميل.
تسجيل تطبيقك
عدّل ملفات التهيئة لمشروع مكتبة العملاء باستخدام بيانات الاعتماد
الجديدة التي أنشأتها للتو. تحقق من وثائق مكتبة العملاء
لمزيد من التفاصيل.
ملاحظة: يجب أن يكون حساب Google المستخدَم للتسجيل هو حساب المطوّر الخاص بك، أي الحساب الذي تريد أن يراه مستخدمو تطبيقك على أنّه مطوّر التطبيق. هذا الحساب لا يلزم ربطه بمعلومات تسجيل دخول إلى AdSense، حيث سيمنح المستخدمون حق الوصول إلى حساباتهم الخاصة أثناء استخدام التطبيق.
دليل البدء السريع
اتّبِع الخطوات أدناه لتقديم طلباتك الأولى، مع العلم أنّ هذه الخطوات قد تختلف قليلاً حسب المكتبة أو اللغة التي تستخدمها:
- استخدِم العيّنة المناسبة لاسترداد قائمة عملاء الإعلانات من
حساب AdSense. يبدأ هذا الطلب عملية لمرة واحدة يصادق من خلالها مستخدم AdSense على مشروعك ويفوّضه.
يمثّل عملاء الإعلانات ارتباطًا بين حساب AdSense وأحد منتجات AdSense، مثل "إعلانات المحتوى" أو "الإعلانات على شبكة البحث".
يمكن أن يحتوي حساب AdSense على عميل إعلانات واحد أو أكثر.
- بالنسبة إلى تطبيقات الويب، ستتم إعادة توجيه المستخدمين إلى موقع إلكتروني
حيث يمكنهم اختيار منح إذن الوصول. بعد التفويض، ستتم إعادة توجيههم إلى عنوان URL لمعاودة الاتصال المحدّد في وحدة تحكُّم Google API.
- تعمل التطبيقات المثبّتة بالطريقة نفسها. وستحاول مكتبة البرامج فتح نافذة متصفّح واستخدام رمز تفويض. وبالنسبة إلى تطبيقات Android وChrome وiOS، ترتبط هذه الطريقة بالنظام الأساسي.
- استخدِم
مستكشف واجهات برمجة تطبيقات Google في
reports.generate
لطلب التقرير التالي:
date_range: YESTERDAY
dimensions: DATE
metrics: ESTIMATED_EARNINGS
تقدّم لك التقارير إحصاءات حول الأرباح التي تحقّقها
بالإضافة إلى العوامل التي تؤثر في هذه الأرباح. ويمكن عرضها على
حساب كامل أو على مجموعة فرعية من الوحدات الإعلانية، من خلال استخدام
القنوات.
- حاوِل طلب التقرير نفسه من طلبك.
- يمكنك فلترة التقارير حسب الوحدات الإعلانية. يمكنك استرجاع قائمة الوحدات الإعلانية باستخدام
adunits.list
.
تجدر الإشارة إلى أنّك تحتاج إلى معرّف عميل الإعلانات (يمكنك الحصول عليه من الخطوة 1). بعد اختيار وحدة إعلانية، استخدِم رقم تعريفها في مَعلمة الفلتر reports.generate
:
الوحدات الإعلانية هي عناصر نائبة يضبطها المستخدمون للإعلانات،
وتحدّد بعض خصائص الإعلانات التي يتم عرضها (مثل الحجم والشكل).
date_range: YESTERDAY
dimensions: DATE
metrics: ESTIMATED_EARNINGS
filter: AD_UNIT_ID==ca-pub-123456789:987654321
- جرِّب الفلترة حسب القنوات المخصّصة أو قنوات عناوين URL أو استخدام فلاتر متعدّدة معًا.
القنوات هي أدوات تتيح لك تتبُّع أداء مجموعة فرعية من وحداتك الإعلانية. هناك نوعان من القنوات:
عنوان URL والقنوات المخصّصة. تتيح لك الطريقة الأولى تتبُّع الأداء على مستوى صفحة أو نطاق محدّد، بينما تساعدك الطريقة الثانية في تتبّع الأداء على مستوى مجموعات محدّدة من الوحدات الإعلانية من اختيار المستخدمين.
أنت جاهز لبدء عملية التنفيذ باستكشاف بقية المكالمات والموارد المتاحة في المستندات
المرجعية.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eStarts ADH import of a specified BigQuery table containing a quarterly brand lift benchmark report, triggered by the customer.\u003c/p\u003e\n"],["\u003cp\u003eRequires specifying the year, quarter, and source BigQuery table in the request body.\u003c/p\u003e\n"],["\u003cp\u003eUses POST request to \u003ccode\u003ehttps://adsdatahub.googleapis.com/v1/{customer=customers/*}:submitBrandLiftBenchmark\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eNeeds \u003ccode\u003ehttps://www.googleapis.com/auth/adsdatahub\u003c/code\u003e authorization scope.\u003c/p\u003e\n"],["\u003cp\u003eReturns an Operation object upon successful submission.\u003c/p\u003e\n"]]],["To use the AdSense Management API, first, obtain an AdSense account and familiarize yourself with it. Select a client library or make direct API requests. Register your application to get a Client ID, and configure your project with the credentials. Retrieve a list of ad clients, then generate reports using the API explorer or your application. Filter reports by ad units or channels, and explore the API reference documentation to start implementing your code.\n"],null,["# Get Started\n\nThis document is for developers who want to use the AdSense Management API to get\ninformation about their AdSense account. This document assumes that you're\nfamiliar with web programming concepts and web data formats.\n\nBefore you start\n----------------\n\n### Get an AdSense account\n\nSign up or sign in to your [AdSense\naccount](//adsense.google.com/) to get started.\n\n### Get familiar with AdSense\n\nIf you're not familiar with AdSense concepts read the [introductory information on AdSense](//support.google.com/adsense)\nand experiment with the [AdSense UI](//adsense.google.com/)\nbefore starting to code.\n\n### Choose your client library\n\nIn the [Client Libraries and Samples\npage](/adsense/management/libraries), you'll find information on the available libraries and samples. Click\nthe tab for your chosen language and follow the links to download the source.\nThe client libraries handle the following for you:\n\n- authentication\n- discovery of services\n- building the requests to the API\n- response parsing\n\nRead the instructions to install and configure your chosen client library,\ntypically found in the README file in the root directory of the repository.\n\nIf your implementation has special needs, such as using an unsupported\nlanguage, you can [make direct\nrequests](/adsense/management/direct_requests) to the API instead of using a client library.\n\nRegister your application\n-------------------------\n\nTo use the AdSense Management API you must register the application you're developing\nby creating a project and generating a Client ID.\nRegister your app\n\nEdit the configuration files for your client library project with the new\ncredentials you just created. Check the client library documentation for more\ndetails.\n\n**Note:** The Google Account used for registration should be\nyour **developer** account, that is, the account that you want users of your\napplication to see as the developer of the application. **This account does\nnot need to be tied to an AdSense login**, as users will be granting access\nto their own accounts while using the application.\n\nQuick start tutorial\n--------------------\n\nFollow the steps below to make your first requests, note that these steps\nmay vary slightly depending on the library or language you are using:\n\n1. Use the appropriate sample to retrieve a list of ad clients from an AdSense account. This request initiates a one-time process in which the AdSense user authenticates and authorizes your project. **Ad clients** represent an association between an\n AdSense account and an AdSense product, such as Content Ads or Search Ads.\n An AdSense account can have one or multiple ad clients.\n\n 1. For **web applications**, users will be redirected to a site where they can choose to grant access. Once authorized, they will be redirected to the callback URL defined in the Google API Console.\n 2. **Installed applications** work similarly. The client library will try to open a browser window and use an authorization code. For Android, Chrome and iOS applications this method is platform-specific.\n2. Use the [Google APIs explorer for\n `reports.generate`](/adsense/management/reference/rest/v2/accounts.reports/generate) to request the following report:\n - `date_range: YESTERDAY`\n - `dimensions: DATE`\n - `metrics: ESTIMATED_EARNINGS`\n\n **Reports** give you insight into what you're earning,\n as well as what's having an impact on those earnings. They can be run on\n an entire account or on a subset of ad units, through the use of\n channels.\n3. Try to request the same report from your application.\n4. You can filter the reports by ad units. Fetch the list of ad units using [adunits.list](/adsense/management/reference/rest/v2/accounts.adclients.adunits/list). Note that an ad client ID is needed (get it from step 1). After you choose an ad unit, use its ID in the [filter](/adsense/management/reporting/filtering) parameter for `reports.generate`:\n\n **Ad Units** are user-configured placeholders for ads,\n that define some properties for the ads being shown (such as size and\n shape).\n - `date_range: YESTERDAY`\n - `dimensions: DATE`\n - `metrics: ESTIMATED_EARNINGS`\n - `filter: AD_UNIT_ID==ca-pub-123456789:987654321`\n5. Try filtering by custom or URL channels or mixing multiple filters. **Channels** are tools that let you track the\n performance of a subset of your ad units. There are two types of channels:\n URL and custom. The former lets you track performance across a specific\n page or domain, whereas the latter help you track performance on specific\n user-selected groups of ad units.\n\nYou are ready to start your implementation by exploring the rest of the\navailable calls and resources in the [reference\ndocumentation](/adsense/management/reference/rest)."]]