সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
লাইব্রেরি System.getProperty("user.home") + "/ads.properties" এ একটি কনফিগারেশন ফাইল খোঁজে। আপনি নিম্নলিখিত পদ্ধতিগুলির যেকোন একটি ব্যবহার করে GoogleAdsClient তৈরি করার সময় রানটাইমে এই পথ এবং ফাইলের নাম ওভাররাইড করতে পারেন:
fromPropertiesFile(PATH_TO_CONFIG_FILE) কল করুন, যেখানে PATH_TO_CONFIG_FILE হল আপনার কনফিগারেশন ফাইলের পাথ এবং ফাইলের নাম।
এনভায়রনমেন্ট ভেরিয়েবল GOOGLE_ADS_CONFIGURATION_FILE_PATH আপনার কনফিগারেশন ফাইলের পাথ এবং ফাইলের নামের সাথে সেট করুন এবং তারপরে fromPropertiesFile() কল করুন।
কনফিগারেশন ফাইলের বিন্যাস হল কী মান জোড়ার একটি জাভা বৈশিষ্ট্য ফাইল। সমর্থিত কীগুলি নির্বাচিত প্রমাণীকরণ প্রবাহের উপর নির্ভর করে পরিবর্তিত হয়।
ডেস্কটপ এবং ওয়েব অ্যাপ্লিকেশন প্রবাহের জন্য সমর্থিত কী
আপনি যদি ডেস্কটপ বা ওয়েব অ্যাপ্লিকেশন ফ্লো ব্যবহার করেন, সমর্থিত কীগুলি নিম্নরূপ:
# Credential for accessing Google's OAuth servers.# Provided by console.cloud.google.com.
api.googleads.clientId=INSERT_CLIENT_ID_HERE
# Credential for accessing Google's OAuth servers.# Provided by console.cloud.google.com.
api.googleads.clientSecret=INSERT_CLIENT_SECRET_HERE
# Renewable OAuth credential associated with 1 or more Google Ads accounts.
api.googleads.refreshToken=INSERT_REFRESH_TOKEN_HERE
# Token which provides access to the Google Ads API in general. It does not# grant access to any particular ad account (OAuth is used for this purpose).
api.googleads.developerToken=INSERT_DEVELOPER_TOKEN_HERE
# Required for manager accounts only: Specify the login customer ID used to# authenticate API calls. This will be the customer ID of the authenticated# manager account. You can also specify this later in code if your application# uses multiple manager account + OAuth pairs.## api.googleads.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE# Only required if explicitly instructed by the service documentation.# api.googleads.linkedCustomerId=INSERT_LINKED_CUSTOMER_ID_HERE# Maximum allowed response payload size, in bytes.# Customize this to allow response sizes for GoogleAdsService.search and# GoogleAdsService.searchStream API calls to exceed the default limit of 64MB.# api.googleads.maxInboundMessageBytes=INSERT_MAX_INBOUND_MESSAGE_BYTES_HERE
পরিষেবা অ্যাকাউন্টের জন্য সমর্থিত কী
আপনি যদি পরিষেবা অ্যাকাউন্ট প্রবাহ ব্যবহার করেন, তাহলে সমর্থিত কীগুলি নিম্নরূপ:
# Path to the service account secrets file in JSON format.# Provided by console.cloud.google.com.
api.googleads.serviceAccountSecretsPath=INSERT_PATH_TO_JSON_HERE
# Email address of the user to impersonate.# This should be a user who has access to your Google Ads account and is in the same# Google Apps Domain as the service account.
api.googleads.serviceAccountUser=INSERT_USER_EMAIL_ADDRESS_HERE
# Token which provides access to the Google Ads API in general. It does not# grant access to any particular ad account (OAuth is used for this purpose).
api.googleads.developerToken=INSERT_DEVELOPER_TOKEN_HERE
# Required for manager accounts only: Specify the login customer ID used to# authenticate API calls. This will be the customer ID of the authenticated# manager account. You can also specify this later in code if your application# uses multiple manager account + OAuth pairs.## api.googleads.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE
GoogleAdsClient এবং এর নির্মাতা বিভিন্ন কনফিগারেশন কৌশলের সমন্বয়ে সমর্থন করে। উদাহরণস্বরূপ, আপনি নিম্নলিখিত স্নিপেট ব্যবহার করে উদাহরণের শংসাপত্র এবং অন্যান্য বৈশিষ্ট্যগুলির জন্য একটি বৈশিষ্ট্য ফাইল কনফিগার করতে পরিবেশ ভেরিয়েবল ব্যবহার করতে পারেন।
এই উদাহরণে, ক্লায়েন্ট লাইব্রেরি বৈশিষ্ট্য ফাইল থেকে মান ব্যবহার করবে যে কোনও বৈশিষ্ট্যের জন্য যা তার এনভায়রনমেন্ট ভেরিয়েবল এবং বৈশিষ্ট্য ফাইলের একটি এন্ট্রি উভয়ের মাধ্যমে সংজ্ঞায়িত করা হয়েছে। বিপরীত আচরণের জন্য, কেবলমাত্র fromEnvironment()fromPropertiesFile() থেকে কল করুন।
আপনি build() কল করার আগে বিল্ডারের অন্যান্য কনফিগারেশন পদ্ধতি ব্যবহার করে রানটাইমে আরও পরিবর্তন করতে পারেন।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-09-03 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Google Ads API Java client library uses a configuration file (\u003ccode\u003eads.properties\u003c/code\u003e by default) or environment variables for settings like credentials and customer IDs.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can authenticate using desktop/web application flows (client ID, secret, refresh token) or service accounts (JSON key file path, impersonated email).\u003c/p\u003e\n"],["\u003cp\u003eThe configuration file format follows Java Properties standards, with specific keys for each authentication method.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment variables can override or complement the configuration file, offering flexibility in setting up the client.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGoogleAdsClient\u003c/code\u003e builder allows combining configuration approaches, prioritizing the last method called for overlapping settings.\u003c/p\u003e\n"]]],[],null,["# Configuration\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThe library looks for a configuration file in\n`System.getProperty(\"user.home\") + \"/ads.properties\"`. You can override this\npath and file name at runtime when constructing the `GoogleAdsClient` using\neither of the following mechanisms:\n\n- Call `fromPropertiesFile(PATH_TO_CONFIG_FILE)`, where `PATH_TO_CONFIG_FILE` is the path and file name of your configuration file.\n- Set the environment variable `GOOGLE_ADS_CONFIGURATION_FILE_PATH` to the path and file name of your configuration file, and then call `fromPropertiesFile()`.\n\nThe format of the configuration file is that of a Java\n[Properties](//docs.oracle.com/javase/tutorial/essential/environment/properties.html)\nfile of key value pairs. The supported keys vary depending on the chosen\nauthentication flow.\n\nSupported keys for desktop and web application flows\n----------------------------------------------------\n\nIf you are using the [desktop](/google-ads/api/docs/client-libs/java/oauth-desktop) or\n[web](/google-ads/api/docs/client-libs/java/oauth-web) application flow, the supported keys\nare as follows: \n\n # Credential for accessing Google's OAuth servers.\n # Provided by console.cloud.google.com.\n api.googleads.clientId=INSERT_CLIENT_ID_HERE\n\n # Credential for accessing Google's OAuth servers.\n # Provided by console.cloud.google.com.\n api.googleads.clientSecret=INSERT_CLIENT_SECRET_HERE\n\n # Renewable OAuth credential associated with 1 or more Google Ads accounts.\n api.googleads.refreshToken=INSERT_REFRESH_TOKEN_HERE\n\n # Token which provides access to the Google Ads API in general. It does not\n # grant access to any particular ad account (OAuth is used for this purpose).\n api.googleads.developerToken=INSERT_DEVELOPER_TOKEN_HERE\n\n # Required for manager accounts only: Specify the login customer ID used to\n # authenticate API calls. This will be the customer ID of the authenticated\n # manager account. You can also specify this later in code if your application\n # uses multiple manager account + OAuth pairs.\n #\n # api.googleads.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE\n\n # Only required if explicitly instructed by the service documentation.\n # api.googleads.linkedCustomerId=INSERT_LINKED_CUSTOMER_ID_HERE\n\n # Maximum allowed response payload size, in bytes.\n # Customize this to allow response sizes for GoogleAdsService.search and\n # GoogleAdsService.searchStream API calls to exceed the default limit of 64MB.\n # api.googleads.maxInboundMessageBytes=INSERT_MAX_INBOUND_MESSAGE_BYTES_HERE\n\nSupported keys for service accounts\n-----------------------------------\n\nIf you are using the [service account](/google-ads/api/docs/client-libs/java/oauth-service)\nflow, the supported keys are as follows: \n\n # Path to the service account secrets file in JSON format.\n # Provided by console.cloud.google.com.\n api.googleads.serviceAccountSecretsPath=INSERT_PATH_TO_JSON_HERE\n\n # Email address of the user to impersonate.\n # This should be a user who has access to your Google Ads account and is in the same\n # Google Apps Domain as the service account.\n api.googleads.serviceAccountUser=INSERT_USER_EMAIL_ADDRESS_HERE\n\n # Token which provides access to the Google Ads API in general. It does not\n # grant access to any particular ad account (OAuth is used for this purpose).\n api.googleads.developerToken=INSERT_DEVELOPER_TOKEN_HERE\n\n # Required for manager accounts only: Specify the login customer ID used to\n # authenticate API calls. This will be the customer ID of the authenticated\n # manager account. You can also specify this later in code if your application\n # uses multiple manager account + OAuth pairs.\n #\n # api.googleads.loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE\n\nUsing environment variables\n---------------------------\n\nThe library supports all of the [environment variables common to all Google Ads API\nclient libraries](/google-ads/api/docs/client-libs#configuration). The table below shows the\nenvironment variable that corresponds to each configuration file property.\n\n| Configuration file property | Environment variable |\n|-------------------------------------------|----------------------------------------|\n| `api.googleads.developerToken` | `GOOGLE_ADS_DEVELOPER_TOKEN` |\n| `api.googleads.clientId` | `GOOGLE_ADS_CLIENT_ID` |\n| `api.googleads.clientSecret` | `GOOGLE_ADS_CLIENT_SECRET` |\n| `api.googleads.refreshToken` | `GOOGLE_ADS_REFRESH_TOKEN` |\n| `api.googleads.serviceAccountSecretsPath` | `GOOGLE_ADS_JSON_KEY_FILE_PATH` |\n| `api.googleads.serviceAccountUser` | `GOOGLE_ADS_IMPERSONATED_EMAIL` |\n| `api.googleads.loginCustomerId` | `GOOGLE_ADS_LOGIN_CUSTOMER_ID` |\n| `api.googleads.linkedCustomerId` | `GOOGLE_ADS_LINKED_CUSTOMER_ID` |\n| `api.googleads.maxInboundMessageBytes` | `GOOGLE_ADS_MAX_INBOUND_MESSAGE_BYTES` |\n\nOnce you have set the appropriate environment variables, configure your\n`GoogleAdsClient` by calling `fromEnvironment()` on the builder. \n\n GoogleAdsClient googleAdsClient = GoogleAdsClient.newBuilder()\n .fromEnvironment()\n .build();\n\nCombining configuration approaches\n----------------------------------\n\nThe `GoogleAdsClient` and its builder support combining different configuration\nstrategies. For example, you can use environment variables to configure the\ncredentials of the instance and a properties file for other attributes using\nthe following snippet. \n\n GoogleAdsClient googleAdsClient = GoogleAdsClient.newBuilder()\n .fromEnvironment()\n .fromPropertiesFile()\n .build();\n\nIn this example, the client library will use the value from the properties file\nfor any attribute that is defined both through its environment variable and an\nentry in the properties file. For the opposite behavior, simply call\n`fromPropertiesFile()` before `fromEnvironment()`.\n\nYou can make further changes at runtime using the builder's other configuration\nmethods before calling `build()`."]]