টার্গেটিং সেটিংস কনফিগার করা

আপনার বিজ্ঞাপন গ্রুপ বা ক্যাম্পেনে টার্গেটিং সেটিং ব্যবহার করে নির্দিষ্ট করুন যে আপনার বিজ্ঞাপন শুধুমাত্র নির্দিষ্ট দর্শক সেগমেন্টকে দেখানো হবে নাকি আপনার বেছে নেওয়া নির্দিষ্ট কন্টেন্টে দেখানো হবে।

টার্গেটিং সেটিং সেট-আপ করা

টার্গেট করার জন্য আপনার বিভিন্ন ধরনের মাপকাঠি কীভাবে ব্যবহার করা হবে সেই সংক্রান্ত বিবরণ আপনি সেট-আপ করতে পারবেন। এটি করতে TargetingSetting ফিল্ডে target_restrictions-এর অ্যারে সেট করুন (অথবা target_restriction_operations ব্যবহার করে ইনক্রিমেন্টাল আপডেট প্রয়োগ করুন)। প্রতিটি TargetRestriction-এর মাধ্যমে আপনি নিয়ন্ত্রণ করতে পারবেন যে কোনও TargetingDimension (AUDIENCE, TOPIC, GENDER, AGE_RANGE, PLACEMENT, PARENTAL_STATUS, অথবা INCOME_RANGE) bid_only বিকল্প ব্যবহার করবে কিনা।

bid_only-কে true-এ সেট করার সময়, টার্গেট করার সেটিংস "পর্যবেক্ষণ"-এ সেট করা হবে এবং ট্রাফিক সীমাবদ্ধ করার জন্য মাপকাঠি ব্যবহার করা হবে না, তবে আপনার তালিকার বিভিন্ন ব্যবহারকারীর জন্য আলাদাভাবে বিড করার অনুমতি দেবে। সেটিং bid_only থেকে false-এ পরিবর্তন করলে টার্গেটিং সেটিং "টার্গেটিং" হিসেবে সেট হয়ে যায় এবং টার্গেট করা তালিকায় থাকা ব্যবহারকারীদের মধ্যে বিজ্ঞাপন গ্রুপের ট্রাফিক সীমাবদ্ধ করার মাপকাঠি চালু হয়ে যায়।

প্রধান পার্থক্যগুলি নিম্নলিখিত সারণীতে সংক্ষিপ্তভাবে তুলে ধরা হয়েছে:

সেটিং bid_only রিচের উপর প্রভাব বিডিংয়ের প্রভাব
লক্ষ্য করা false বেছে নেওয়া মাপকাঠি শুধুমাত্র পূরণ করে এমন ব্যবহারকারীদের কাছে পৌঁছায় মাপকাঠির ভিত্তিতে নির্দিষ্ট বিড সেট করতে পারবেন
অবজার্ভেশন true রিচ কম করে না; বিজ্ঞাপন স্বাভাবিকভাবে দেখানো হয় মাপকাঠির উপর ভিত্তি করে বিড অ্যাডজাস্ট করার অনুমতি দেয়

বাস্তব পরিস্থিতি

কখন টার্গেটিং মোডের পরিবর্তে অবজার্ভেশন মোড ব্যবহার করতে হবে, তার সংক্ষিপ্ত উদাহরণ এখানে দেওয়া হল:

অবজার্ভেশন
আপনি যদি কোনও সার্চ ক্যাম্পেন চালান এবং জানতে চান যে কোনও নির্দিষ্ট দর্শক (যেমন, "খেলাধূলা প্রেমী") সাধারণ দর্শকদের তুলনায় কত ভালভাবে কনভার্ট করে, তাহলে 'পর্যবেক্ষণ' মোড ব্যবহার করুন। তবে, আপনার বিজ্ঞাপন শুধু সেই দর্শকদের মধ্যেই সীমাবদ্ধ রাখবেন না। আপনি bid_only = true (পর্যবেক্ষণ) সহ দর্শক সংক্রান্ত মাপকাঠি হিসেবে "খেলাধূলার অনুরাগী" যোগ করতে পারেন এবং ১০% বিড অ্যাডজাস্টমেন্ট প্রয়োগ করতে পারেন। এর ফলে আপনি সেই অডিয়েন্সের জন্য পারফর্ম্যান্স ডেটা সংগ্রহ করতে পারবেন এবং তারা ভালো পারফর্ম করলে, সেই অডিয়েন্সের বাইরে থাকা ব্যবহারকারীদের থেকে ট্রাফিক না হারিয়েই, তাদের জন্য আরও প্রতিযোগিতামূলক বিড করতে পারবেন।
লক্ষ্য করা
টার্গেটিং মোড ব্যবহার করুন যদি আপনি এমন ব্যবহারকারীদের রিমার্কেট করার জন্য ডিসপ্লে ক্যাম্পেন চালান যারা আগে আপনার ওয়েবসাইট ভিজিট করেছেন কিন্তু কনভার্ট করেননি এবং আপনি শুধুমাত্র আপনার "কার্ট পরিত্যাগকারী" ব্যবহারকারীর তালিকায় থাকা ব্যবহারকারীদের এই নির্দিষ্ট বিজ্ঞাপনগুলি দেখাতে চান। এই ক্ষেত্রে, আপনি "কার্ট পরিত্যাগকারী" তালিকাটি UserList মানদণ্ড হিসেবে bid_only = false (টার্গেটিং) সহ যোগ করেন। এটি নিশ্চিত করে যে আপনার বিজ্ঞাপন গ্রুপের বাজেট শুধুমাত্র এই হাই-ইন্টেন্ট অডিয়েন্স সেগমেন্টের কাছে পৌঁছানোর জন্য খরচ করা হয়।

পেশাদার পদ্ধতি

ডিফল্ট হিসেবে, bid_only, false হিসেবে সেট করা থাকে, যার অর্থ হল টার্গেটিং সেটিং "টার্গেটিং" হিসেবে সেট করা থাকবে। নির্দিষ্ট টার্গেটিং ডাইমেনশনের (যেমন AUDIENCE) জন্য টার্গেট সংক্রান্ত বিধিনিষেধ TargetingSetting-এর target_restrictions অ্যারে থেকে বাদ দেওয়া হলে বা না থাকলে, সিস্টেম সেই ডাইমেনশনের জন্য "টার্গেটিং" (bid_only হল অন্তর্নিহিত false) ডিফল্ট অ্যাকশন গ্রহণ করে।

এই লো-লেভেল API-এর আচরণ Google Ads UI-এর থেকে আলাদা হতে পারে, যা ক্যাম্পেন বা বিজ্ঞাপন গ্রুপ তৈরি করার সময় কিছু টার্গেটিং ডাইমেনশনের (যেমন সার্চ ক্যাম্পেনের জন্য AUDIENCE) ক্ষেত্রে ডিফল্ট হিসেবে অটোমেটিক "পর্যবেক্ষণ" (bid_only হল true) প্রয়োগ করতে পারে। যেমন, UI-এর মাধ্যমে তৈরি করা শপিং ক্যাম্পেন API-এর দৃষ্টিকোণ থেকে ডিফল্টভাবে AUDIENCE ডাইমেনশন সেটিংস বাদ দিতে পারে, যার অর্থ হল, তারা ডিফল্ট API-এর "টার্গেটিং" (bid_only হল false) আচরণকে অন্তর্নিহিতভাবে গ্রহণ করে।

আপনি Search বা Shopping ক্যাম্পেনে দর্শক বিভাগ যোগ করলে, bid_only-এর টার্গেটিং সেটিংকে true হিসেবে স্পষ্টভাবে কনফিগার করার কথা বিবেচনা করুন, যাতে এটি "পর্যবেক্ষণ" হিসেবে সেট করা যায়।

আপনি যদি সার্চ বিজ্ঞাপনের জন্য দর্শক বিভাগের ডুপ্লিকেট ক্যাম্পেন সেট-আপ করেন, তাহলে bid_only-এর টার্গেটিং false হিসেবে সেট করা আছে কিনা দেখুন।

বিধিনিষেধ

আপনি targeting_setting যোগ বা আপডেট করতে পারবেন না AdGroup-এ যদি targeting_setting সেট করা থাকে মূল ক্যাম্পেনে। targeting_setting যদি মূল Campaign-এ সেট করা থাকে, তাহলে আপনাকে প্রথমে মূল Campaign থেকে targeting_setting সরাতে হবে। একইভাবে, Campaign-এ সেট করতে হলে, প্রথমে আপনাকে AdGroup-এ targeting_setting সরাতে হবে।

Campaign বা AdGroup থেকে targeting_setting সরাতে, এমন একটি update অপারেশন পাঠান যেখানে targeting_setting.target_restrictions মুছে দেওয়া হয়েছে (খালি তালিকা হিসেবে সেট করা হয়েছে) এবং update_mask-এ targeting_setting.target_restrictions অন্তর্ভুক্ত করুন।

টার্গেট করার সেটিংস ফিরিয়ে আনুন

আপনার টার্গেটিং আপনার ইচ্ছা অনুযায়ী সেট-আপ করা হয়েছে কিনা তা যাচাই করতে, targeting_setting বিজ্ঞাপন গ্রুপ বা ক্যাম্পেনে চেক করুন। এর জন্য সার্চ কোয়েরিতে ad_group রিসোর্স থেকে ad_group.targeting_setting.target_restrictions ফিল্ড অথবা campaign রিসোর্স থেকে campaign.targeting_setting.target_restrictions ফিল্ডের জন্য অনুরোধ করুন।

উদাহরণ

এই উদাহরণটি বিজ্ঞাপন গ্রুপের targeting_setting আপডেট করে যাতে bid_only targeting_dimension-এর AUDIENCE সহ TargetRestriction ইনস্ট্যান্সের জন্য true হয়, যা আপনাকে পারফর্ম্যান্স পর্যবেক্ষণ করতে এবং রিচ সীমাবদ্ধ না করেই দর্শক বিভাগের ব্যবহারকারীদের জন্য বিড অ্যাডজাস্টমেন্ট সেট করতে দেয়।

প্রথমে, প্রদত্ত আইডি সহ বিজ্ঞাপন গ্রুপ থেকে সব ad_group.targeting_setting.target_restrictions ফিরিয়ে আনুন।

Java

String searchQuery =
    "SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions "
        + "FROM ad_group "
        + "WHERE ad_group.id = "
        + adGroupId;
      

C#

string query = $@"
    SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions
    FROM ad_group
    WHERE ad_group.id = {adGroupId}";
      

PHP

$query = "SELECT ad_group.id, ad_group.name, " .
    "ad_group.targeting_setting.target_restrictions " .
    "FROM ad_group " .
    "WHERE ad_group.id = $adGroupId";
      

Python

query: str = f"""
    SELECT
      ad_group.id,
      ad_group.name,
      ad_group.targeting_setting.target_restrictions
    FROM ad_group
    WHERE ad_group.id = {ad_group_id}"""
      

Ruby

query = <<~QUERY
  SELECT ad_group.id, ad_group.name,
         ad_group.targeting_setting.target_restrictions
  FROM ad_group
  WHERE ad_group.id = #{ad_group_id}
QUERY
      

Perl

my $query =
  "SELECT ad_group.id, ad_group.name, " .
  "ad_group.targeting_setting.target_restrictions FROM ad_group " .
  "WHERE ad_group.id = $ad_group_id";
      

কার্ল

এরপর, টার্গেট সংক্রান্ত বিধিনিষেধের মাধ্যমে লুপ করুন এবং TargetingSetting অবজেক্ট আবার তৈরি করুন। কোডটি যদি AUDIENCE-এর targeting_dimension সহ TargetRestriction এবং false-এর bid_only ভ্যালু দেখতে পায়, তাহলে এটি TargetRestriction অবজেক্টের bid_only ফিল্ডকে true (বা "পর্যবেক্ষণ") হিসেবে আপডেট করে এবং TargetingSetting অবজেক্টে যোগ করে। অন্যথায়, সার্ভার থেকে পাওয়া TargetRestriction অবজেক্টটি TargetingSetting-এ যোগ করুন।

Java

for (TargetRestriction targetRestriction : targetRestrictions) {
  TargetingDimension targetingDimension = targetRestriction.getTargetingDimension();
  boolean bidOnly = targetRestriction.getBidOnly();
  System.out.printf(
      "- Targeting restriction with targeting dimension '%s' and bid only set to '%b'.%n",
      targetingDimension, bidOnly);
  // Adds the target restriction to the TargetingSetting object as is if the targeting
  // dimension has a value other than AUDIENCE because those should not change.
  if (!targetingDimension.equals(TargetingDimension.AUDIENCE)) {
    targetingSettingBuilder.addTargetRestrictions(targetRestriction);
  } else if (!bidOnly) {
    shouldUpdateTargetingSetting = true;
    // Adds an AUDIENCE target restriction with bid_only set to true to the targeting
    // setting object. This has the effect of setting the AUDIENCE target restriction to
    // "Observation". For more details about the targeting setting, visit
    // https://support.google.com/google-ads/answer/7365594.
    targetingSettingBuilder.addTargetRestrictions(
        TargetRestriction.newBuilder()
            .setTargetingDimensionValue(TargetingDimension.AUDIENCE_VALUE)
            .setBidOnly(true));
  }
}
      

C#

foreach (TargetRestriction targetRestriction in targetRestrictions)
{
    TargetingDimension targetingDimension =
        targetRestriction.TargetingDimension;
    bool bidOnly = targetRestriction.BidOnly;

    Console.WriteLine("\tTargeting restriction with targeting dimension " +
        $"'{targetingDimension}' and bid only set to '{bidOnly}'.");

    // Add the target restriction to the TargetingSetting object as is if the
    // targeting dimension has a value other than AUDIENCE because those should
    // not change.
    if (targetingDimension != TargetingDimension.Audience)
    {
        targetingSetting.TargetRestrictions.Add(targetRestriction);
    }
    else if (!bidOnly)
    {
        shouldUpdateTargetingSetting = true;

        // Add an AUDIENCE target restriction with bid_only set to true to the
        // targeting setting object. This has the effect of setting the AUDIENCE
        // target restriction to "Observation". For more details about the
        // targeting setting, visit
        // https://support.google.com/google-ads/answer/7365594.
        targetingSetting.TargetRestrictions.Add(new TargetRestriction
        {
            TargetingDimension = TargetingDimension.Audience,
            BidOnly = true
        });
    }
}
      

PHP

foreach (
    $adGroup->getTargetingSetting()->getTargetRestrictions() as $targetRestriction
) {
    // Prints the results.
    $targetingDimension = $targetRestriction->getTargetingDimension();
    $bidOnly = $targetRestriction->getBidOnly();
    printf(
        "- Targeting restriction with targeting dimension '%s' and bid only set to " .
        "'%s'.%s",
        TargetingDimension::name($targetingDimension),
        $bidOnly ? 'true' : 'false',
        PHP_EOL
    );

    // Adds the target restriction to the TargetingSetting object as is if the targeting
    // dimension has a value other than AUDIENCE because those should not change.
    if ($targetingDimension !== TargetingDimension::AUDIENCE) {
        $targetRestrictions[] = $targetRestriction;
    } elseif (!$bidOnly) {
        $shouldUpdateTargetingSetting = true;

        // Adds an AUDIENCE target restriction with bid_only set to true to the
        // targeting setting object. This has the effect of setting the AUDIENCE
        // target restriction to "Observation".
        // For more details about the targeting setting, visit
        // https://support.google.com/google-ads/answer/7365594.
        $targetRestrictions[] = new TargetRestriction(
            [
            'targeting_dimension' => TargetingDimension::AUDIENCE,
            'bid_only' => true
            ]
        );
    }
}
      

Python

target_restriction: TargetRestriction
for target_restriction in target_restrictions:
    targeting_dimension: TargetingDimensionEnum.TargetingDimension = (
        target_restriction.targeting_dimension
    )
    bid_only: bool = target_restriction.bid_only

    print(
        "\tTargeting restriction with targeting dimension "
        f"'{targeting_dimension.name}' "
        f"and bid only set to '{bid_only}'."
    )

    # Add the target restriction to the TargetingSetting object as
    # is if the targeting dimension has a value other than audience
    # because those should not change.
    if targeting_dimension != targeting_dimension_enum.AUDIENCE:
        targeting_setting.target_restrictions.append(target_restriction)
    elif not bid_only:
        should_update_targeting_setting: bool = True

        # Add an audience target restriction with bid_only set to
        # true to the targeting setting object. This has the effect
        # of setting the audience target restriction to
        # "Observation". For more details about the targeting
        # setting, visit
        # https://support.google.com/google-ads/answer/7365594.
        new_target_restriction: TargetRestriction = (
            targeting_setting.target_restrictions.add()
        )
        new_target_restriction.targeting_dimension = (
            targeting_dimension_enum.AUDIENCE
        )
        new_target_restriction.bid_only = True
      

Ruby

ad_group.targeting_setting.target_restrictions.each do |r|
  # Prints the results.
  targeting_dimension = r.targeting_dimension
  bid_only = r.bid_only
  puts "- Targeting restriction with targeting dimension " \
    "#{targeting_dimension} and bid only set to #{bid_only}."

  # Adds the target restriction to the TargetingSetting object as is if the
  # targeting dimension has a value other than AUDIENCE because those should
  # not change.
  if targeting_dimension != :AUDIENCE
    target_restrictions << r
  elsif !bid_only
    should_update_targeting_setting = true

    # Adds an AUDIENCE target restriction with bid_only set to true to the
    # targeting setting object. This has the effect of setting the AUDIENCE
    # target restriction to "Observation".
    # For more details about the targeting setting, visit
    # https://support.google.com/google-ads/answer/7365594.
    target_restrictions << client.resource.target_restriction do |tr|
      tr.targeting_dimension = :AUDIENCE
      tr.bid_only = true
    end
  end
end
      

Perl

foreach my $target_restriction (@target_restrictions) {
  my $targeting_dimension = $target_restriction->{targetingDimension};

  printf
    "\tTargeting restriction with targeting dimension '%s' and bid " .
    "only set to '%s'.\n",
    $targeting_dimension,
    $target_restriction->{bidOnly} ? "TRUE" : "FALSE";

  # Add the target restriction to the TargetingSetting object as is if the
  # targeting dimension has a value other than AUDIENCE because those
  # should not change.
  if ($targeting_dimension ne AUDIENCE) {
    $target_restriction->{bidOnly} =
      $target_restriction->{bidOnly} ? "true" : "false";
    push @{$targeting_setting->{targetRestrictions}}, $target_restriction;
  } elsif (!$target_restriction->{bidOnly}) {
    $should_update_target_setting = 1;

    # Add an AUDIENCE target restriction with bid_only set to true to the
    # targeting setting object. This has the effect of setting the
    # AUDIENCE target restriction to "Observation". For more details about
    # the targeting setting, visit
    # https://support.google.com/google-ads/answer/7365594.
    my $new_restriction =
      Google::Ads::GoogleAds::V26::Common::TargetRestriction->new({
        targetingDimension => AUDIENCE,
        bidOnly            => "true"
      });
    push @{$targeting_setting->{targetRestrictions}}, $new_restriction;
  }
}
      

কার্ল

অবশেষে, কোডটি যদি এমন কোনও টার্গেট বিধিনিষেধের সম্মুখীন হয় যার জন্য আপডেট করার প্রয়োজন হয়, তাহলে এটি নতুন টার্গেটিং সেটিংস সহ বিজ্ঞাপন গ্রুপ আপডেট করে।

Java

private void updateTargetingSetting(
    GoogleAdsClient googleAdsClient,
    long customerId,
    long adGroupId,
    TargetingSetting targetingSetting) {
  // Creates the ad group service client.
  try (AdGroupServiceClient adGroupServiceClient =
      googleAdsClient.getLatestVersion().createAdGroupServiceClient()) {
    // Creates an ad group object with the proper resource name and updated targeting setting.
    AdGroup adGroup =
        AdGroup.newBuilder()
            .setResourceName(ResourceNames.adGroup(customerId, adGroupId))
            .setTargetingSetting(targetingSetting)
            .build();
    // Constructs an operation that will update the ad group, using the FieldMasks utility to
    // derive the update mask. This mask tells the Google Ads API which attributes of the
    // ad group you want to change.
    AdGroupOperation operation =
        AdGroupOperation.newBuilder()
            .setUpdate(adGroup)
            .setUpdateMask(FieldMasks.allSetFieldsOf(adGroup))
            .build();
    // Sends the operation in a mutate request.
    MutateAdGroupsResponse response =
        adGroupServiceClient.mutateAdGroups(
            Long.toString(customerId), ImmutableList.of(operation));
    // Prints the resource name of the updated object.
    System.out.printf(
        "Updated targeting setting of ad group with resource name '%s'; set the AUDIENCE "
            + "target restriction to 'Observation'.%n",
        response.getResults(0).getResourceName());
  }
}
      

C#

private void UpdateTargetingSetting(GoogleAdsClient client, long customerId, long
    adGroupId, TargetingSetting targetingSetting)
{
    // Get the AdGroupService client.
    AdGroupServiceClient adGroupServiceClient =
        client.GetService(Services.V26.AdGroupService);

    // Create an ad group object with the updated targeting setting.
    AdGroup adGroup = new AdGroup
    {
        ResourceName = ResourceNames.AdGroup(customerId, adGroupId),
        TargetingSetting = targetingSetting
    };

    // Construct an operation that will update the ad group, using the FieldMasks utility
    // to derive the update mask. This mask tells the Google Ads API which attributes of the
    // ad group you want to change.
    AdGroupOperation operation = new AdGroupOperation
    {
        Update = adGroup,
        UpdateMask = FieldMasks.AllSetFieldsOf(adGroup)
    };

    // Send the operation in a mutate request.
    MutateAdGroupsResponse response =
        adGroupServiceClient.MutateAdGroups(customerId.ToString(), new[] { operation });
    // Print the resource name of the updated object.
    Console.WriteLine("Updated targeting setting of ad group with resource name " +
        $"'{response.Results.First().ResourceName}'; set the AUDIENCE target restriction " +
        "to 'Observation'.");
}
      

PHP

private static function updateTargetingSetting(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $adGroupId,
    TargetingSetting $targetingSetting
) {
    // Creates an ad group object with the proper resource name and updated targeting setting.
    $adGroup = new AdGroup(
        [
        'resource_name' => ResourceNames::forAdGroup($customerId, $adGroupId),
        'targeting_setting' => $targetingSetting
        ]
    );

    // Constructs an operation that will update the ad group with the specified resource name,
    // using the FieldMasks utility to derive the update mask. This mask tells the Google Ads
    // API which attributes of the ad group you want to change.
    $adGroupOperation = new AdGroupOperation();
    $adGroupOperation->setUpdate($adGroup);
    $adGroupOperation->setUpdateMask(FieldMasks::allSetFieldsOf($adGroup));

    // Issues a mutate request to update the ad group.
    $adGroupServiceClient = $googleAdsClient->getAdGroupServiceClient();
    $response = $adGroupServiceClient->mutateAdGroups(
        MutateAdGroupsRequest::build($customerId, [$adGroupOperation])
    );

    // Prints the resource name of the updated ad group.
    printf(
        "Updated targeting setting of ad group with resource name '%s'; set the AUDIENCE " .
        "target restriction to 'Observation'.%s",
        $response->getResults()[0]->getResourceName(),
        PHP_EOL
    );
}
      

Python

def update_targeting_setting(
    client: GoogleAdsClient,
    customer_id: str,
    ad_group_id: str,
    targeting_setting: TargetingSetting,
) -> None:
    """Updates the given TargetingSetting of an ad group.

    Args:
        client: The Google Ads client.
        customer_id: The Google Ads customer ID.
        ad_group_id: The ad group ID for which to update the audience targeting
            restriction.
        targeting_setting: The updated targeting setting.
    """
    # Get the AdGroupService client.
    ad_group_service: AdGroupServiceClient = client.get_service(
        "AdGroupService"
    )

    # Construct an operation that will update the ad group.
    ad_group_operation: AdGroupOperation = client.get_type("AdGroupOperation")

    # Populate the ad group object with the updated targeting setting.
    ad_group: AdGroup = ad_group_operation.update
    ad_group.resource_name = ad_group_service.ad_group_path(
        customer_id, ad_group_id
    )
    ad_group.targeting_setting.target_restrictions.extend(
        targeting_setting.target_restrictions
    )
    # Use the field_mask utility to derive the update mask. This mask tells the
    # Google Ads API which attributes of the ad group you want to change.
    client.copy_from(
        ad_group_operation.update_mask,
        protobuf_helpers.field_mask(None, ad_group._pb),
    )

    # Send the operation in a mutate request and print the resource name of the
    # updated object.
    mutate_ad_groups_response: MutateAdGroupsResponse = (
        ad_group_service.mutate_ad_groups(
            customer_id=customer_id, operations=[ad_group_operation]
        )
    )
    print(
        "Updated targeting setting of ad group with resource name "
        f"'{mutate_ad_groups_response.results[0].resource_name}'; set the "
        "audience target restriction to 'Observation'."
    )
      

Ruby

def update_targeting_setting(
  client,
  customer_id,
  ad_group_id,
  targeting_setting)
  # Constructs an operation that will update the ad group with the specified
  # resource name.
  ad_group_resource_name = client.path.ad_group(customer_id, ad_group_id)
  operation = client.operation.update_resource.ad_group(ad_group_resource_name) do |ag|
    ag.targeting_setting = targeting_setting
  end

  # Issues a mutate request to update the ad group.
  response = client.service.ad_group.mutate_ad_groups(
    customer_id: customer_id,
    operations: [operation],
  )

  # Prints the resource name of the updated ad group.
  puts "Updated targeting setting of ad group with resource name " \
    "#{response.results.first.resource_name}; set the AUDIENCE target " \
    "restriction to 'Observation'."
end
      

Perl

sub update_targeting_setting {
  my ($api_client, $customer_id, $ad_group_id, $targeting_setting) = @_;

  # Construct an ad group object with the updated targeting setting.
  my $ad_group = Google::Ads::GoogleAds::V26::Resources::AdGroup->new({
      resourceName =>
        Google::Ads::GoogleAds::V26::Utils::ResourceNames::ad_group(
        $customer_id, $ad_group_id
        ),
      targetingSetting => $targeting_setting
    });

  # Create an operation that will update the ad group, using the FieldMasks
  # utility to derive the update mask. This mask tells the Google Ads API which
  # attributes of the ad group you want to change.
  my $ad_group_operation =
    Google::Ads::GoogleAds::V26::Services::AdGroupService::AdGroupOperation->
    new({
      update     => $ad_group,
      updateMask => all_set_fields_of($ad_group)});

  # Send the operation in a mutate request and print the resource name of the
  # updated resource.
  my $ad_groups_response = $api_client->AdGroupService()->mutate({
      customerId => $customer_id,
      operations => [$ad_group_operation]});

  printf "Updated targeting setting of ad group with resourceName " .
    "'%s'; set the AUDIENCE target restriction to 'Observation'.\n",
    $ad_groups_response->{results}[0]{resourceName};
}
      

কার্ল

ক্যাম্পেনের জন্য bid_only ফিল্ড সেট করার প্রসেস প্রায় একই রকম।

এর পরে কী করতে হবে