সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
নির্বাচকরা প্রোগ্রামারকে অনুরোধ করা Google Ads এন্টিটি নিয়ে আসা কোয়েরি তৈরি করতে সাহায্য করে। নির্বাচকদের সাথে, কেউ পুনরুদ্ধার করা সত্তার তালিকা সংকুচিত করতে পারে এবং অর্ডার করতে পারে। বেশিরভাগ নির্বাচকদের নিম্নলিখিত পদ্ধতি রয়েছে:
withCondition()
একটি নির্বাচক একটি শর্ত যোগ করে. যদি একাধিক শর্ত ব্যবহার করা হয়, সেগুলি একসাথে AND-ed হয়, অন্য কথায়, নির্বাচক শুধুমাত্র সেই সত্তাগুলিকে ফেরত দেবেন যা নির্দিষ্ট সমস্ত শর্ত পূরণ করে।
withIds()
শর্ত হিসেবে আইডির একটি সংগ্রহ যোগ করে। একটি আইডি-ভিত্তিক শর্ত অন্য সকলের সাথে একসাথে AND-ed হবে।
forDateRange()
প্রয়োজন হয় যখন একটি শর্ত বা অর্ডারিং ক্লজ একটি পরিসংখ্যান ক্ষেত্রের উল্লেখ করে, যেমন Ctr বা ইমপ্রেশন। আপনি যদি 100 টিরও বেশি ইম্প্রেশন সহ সমস্ত প্রচারাভিযানের অনুরোধ করেন, Google বিজ্ঞাপন স্ক্রিপ্টগুলি দেখার জন্য তারিখের পরিসর জানতে হবে৷
orderBy()
প্রত্যাবর্তিত সত্তার ক্রম নির্দিষ্ট করে।
withLimit()
প্রত্যাবর্তিত সত্তার সংখ্যা নির্দিষ্ট মানের মধ্যে সীমাবদ্ধ করে। "গতকাল সর্বাধিক ইম্প্রেশন সহ 10টি কীওয়ার্ড" এর মতো জিনিসগুলি আনার জন্য orderBy() এর সাথে এটি বিশেষভাবে কার্যকর। ডিফল্টরূপে, সমস্ত নির্বাচকরা সীমা 50,000 এ সেট করবে। আপনি ম্যানুয়ালি একটি সীমা নির্দিষ্ট করে সীমা বাড়াতে পারেন।
এই পদ্ধতিগুলি যে কোনও ক্রমে বলা যেতে পারে। একটি ব্যতিক্রম হল orderBy() , যেখানে কলের ক্রম আসলেই গুরুত্বপূর্ণ: এই পদ্ধতিতে একাধিক কল একাধিক অর্ডারিং ক্লজ নির্দিষ্ট করবে এবং সেগুলি ক্রমানুসারে প্রযোজ্য হবে। নিম্নলিখিত স্নিপেট বিবেচনা করুন:
[null,null,["2025-09-03 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eSelectors in Google Ads scripts are used to retrieve specific entities like campaigns or keywords by constructing queries.\u003c/p\u003e\n"],["\u003cp\u003eSelectors offer methods like \u003ccode\u003ewithCondition()\u003c/code\u003e, \u003ccode\u003ewithIds()\u003c/code\u003e, \u003ccode\u003eforDateRange()\u003c/code\u003e, \u003ccode\u003eorderBy()\u003c/code\u003e, and \u003ccode\u003ewithLimit()\u003c/code\u003e to refine and order results.\u003c/p\u003e\n"],["\u003cp\u003eMultiple conditions added using \u003ccode\u003ewithCondition()\u003c/code\u003e are treated as AND conditions, requiring entities to satisfy all of them.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eorderBy()\u003c/code\u003e allows sorting results based on specified criteria, and calling it multiple times adds further ordering levels.\u003c/p\u003e\n"],["\u003cp\u003eChaining selector methods simplifies code and enhances readability by applying multiple operations in a single statement.\u003c/p\u003e\n"]]],[],null,["# Selectors help the programmer construct the query that fetches requested\nGoogle Ads entities. With selectors, one can narrow down the list of\nretrieved entities and order it. Most selectors have the following\nmethods:\n\n`withCondition()`\n: Adds a condition to a selector. If multiple conditions are used, they are\n AND-ed together, in other words, the selector will only return entities that\n satisfy **all** of the specified conditions.\n\n`withIds()`\n: Adds a collection of [IDs](/google-ads/scripts/docs/concepts/ids) as a\n condition. An ID-based condition will be AND-ed together with all the others.\n\n`forDateRange()`\n: Is needed when a condition or ordering clause references a\n [Stats](/google-ads/scripts/docs/reference/adsapp/adsapp_stats) field, such as\n Ctr or Impressions. If you request all campaigns with over 100 impressions,\n Google Ads scripts will need to know the date range to look into.\n\n`orderBy()`\n: Specifies the ordering of the returned entities.\n\n`withLimit()`\n: Limits the number of returned entities to the specified value. It is\n particularly useful in conjunction with `orderBy()` in order to fetch things\n like \"10 keywords with most impressions yesterday\". By default, all selectors\n will set the limit to 50,000. You can increase the limit by manually specifying\n a limit.\n\nThese methods can be called in any order. One exception is `orderBy()`, where\norder of calls indeed matters: multiple calls to this method will specify\nmultiple ordering clauses, and they will apply in order. Consider the\nfollowing snippet: \n\n selector = selector.forDateRange(\"LAST_14_DAYS\")\n .orderBy(\"metrics.clicks DESC\")\n .orderBy(\"metrics.ctr ASC\");\n\nThe results will be ordered by Clicks in descending order. Results with equal\nClicks values will be ordered by Ctr in ascending order.\n\nCalls to a selector's methods can be chained together. The following code \n\n var campaignSelector = AdsApp.campaigns();\n campaignSelector.withCondition(\"metrics.clicks \u003e 10\");\n campaignSelector.withCondition(\"metrics.impressions \u003e 1000\");\n campaignSelector.orderBy(\"metrics.impressions DESC\");\n campaignSelector.forDateRange(\"YESTERDAY\");\n\ncan be re-written in a more compact fashion: \n\n var campaignSelector = AdsApp.campaigns()\n .withCondition(\"metrics.clicks \u003e 10\")\n .withCondition(\"metrics.impressions \u003e 1000\")\n .orderBy(\"metrics.impressions DESC\")\n .forDateRange(\"YESTERDAY\");\n\nOnce the selector is constructed, one can obtain an\n[Iterator](/google-ads/scripts/docs/concepts/iterators) from it by calling\n`selector.get()`.\n| **Note:** Some selectors (for example [`AdParamSelector`](/google-ads/scripts/docs/reference/adsapp/adsapp_adparamselector) and [`LabelSelector`](/google-ads/scripts/docs/reference/adsapp/adsapp_labelselector)) expose fewer methods since they operate on entities that are more restricted (don't have any stats or meaningful fields to order by).\n\nRead [Best Practices](/google-ads/scripts/docs/best-practices) for tips\nand tricks on efficient selector usage."]]