নির্দিষ্ট পৃষ্ঠার দর্শক

আপনি একটি flexible_rule_user_list ব্যবহার করে আপনার ওয়েবসাইটের নির্দিষ্ট পৃষ্ঠা বা বিভাগগুলি পরিদর্শন করেছেন এমন লোকেদের বিজ্ঞাপন লক্ষ্য করতে পারেন, যা আপনাকে আপনার ওয়েবসাইটের ডোমেনের চেয়ে নির্দিষ্ট URLগুলিকে লক্ষ্য করতে দেয়৷

পূর্বশর্ত

শ্রোতা বিভাগ তৈরি এবং লক্ষ্য করার জন্য, আপনাকে প্রথমে করতে হবে:

  1. আগ্রহ এবং অবস্থানের উপর ভিত্তি করে বিজ্ঞাপনের নীতি পর্যালোচনা করুন৷ ব্যবহারকারীদের সম্পর্কে সংবেদনশীল তথ্য দর্শক তৈরি করতে ব্যবহার করা যাবে না।

  2. আপনার Google ট্যাগ সেট আপ করুন.

    যে বিজ্ঞাপনদাতারা মোবাইল অ্যাপের আচরণের উপর ভিত্তি করে ব্যবহারকারীর তালিকা তৈরি করতে চান তাদের Firebase SDK প্রয়োগ করা উচিত বা অ্যাপ-মধ্যস্থ আচরণ ট্র্যাক করার জন্য তৃতীয় পক্ষের SDK-এর সাথে কাজ করা উচিত।

গুগল ট্যাগ পুনরুদ্ধার করুন

সমস্ত Google বিজ্ঞাপন অ্যাকাউন্টে ঠিক একটি অ্যাকাউন্ট-স্তরের Google ট্যাগ থাকে, যখন অ্যাকাউন্ট খোলা হয় তখন স্বয়ংক্রিয়ভাবে তৈরি হয়।

আপনি সহায়তা কেন্দ্রের নির্দেশাবলী অনুসরণ করে Google বিজ্ঞাপন UI-তে Google ট্যাগ পুনরুদ্ধার করতে পারেন বা Google Ads API-এ একটি RemarketingAction তৈরি করে এবং তারপর remarketing_action রিসোর্স ব্যবহার করে একটি GoogleAdsService.searchStream অনুরোধ জারি করে Google ট্যাগ পুনরুদ্ধার করতে পারেন:

SELECT
  remarketing_action.id,
  remarketing_action.name,
  remarketing_action.tag_snippets
FROM remarketing_action
WHERE remarketing_action.resource_name = 'REMARKETING_ACTION_RESOURCE_NAME'

আপনার ওয়েবসাইট বা অ্যাপে Google ট্যাগ ইনস্টল করুন

পরবর্তী ধাপ হল আপনার সাইটের সমস্ত পৃষ্ঠায় আপনার Google ট্যাগ ইনস্টল করা। আপনার সাইট বা মোবাইল অ্যাপে Google ট্যাগ যোগ করার বিষয়ে আরও জানুন

আপনি যদি শুধুমাত্র পরিদর্শন করা পৃষ্ঠার URL-এর উপর ভিত্তি করে শ্রোতা বিভাগ তৈরি করার পরিকল্পনা করছেন, তাহলে আপনাকে আপনার Google ট্যাগে কোনো সম্পাদনা করতে হবে না। আপনি যদি কাস্টম প্যারামিটার ব্যবহার করেন, তাহলে ট্যাগিং এবং পুনঃবিপণন তালিকা তৈরির জন্য উন্নত কৌশলগুলিতে বিশদ বিবরণ অনুসারে আপনাকে তাদের অন্তর্ভুক্ত করতে আপনার ট্যাগ সম্পাদনা করতে হবে।

আপনি আপনার ট্যাগ ইনস্টলেশন যাচাই করতে Google ট্যাগ সহকারী ব্যবহার করতে পারেন।

অন্তর্নির্মিত Google ট্যাগ প্যারামিটার

আপনি বিল্ট-ইন পুনঃবিপণন প্যারামিটার url__ ব্যবহার করতে পারেন আপনার ওয়েবসাইটের ভিজিটরদের উদাহরণে প্রদর্শিত ইউআরএলগুলির উপর ভিত্তি করে একটি ব্যবহারকারীর তালিকাকে টার্গেট করতে।

কাস্টম Google ট্যাগ প্যারামিটার

আরও উপযোগী ব্যবহারকারী তালিকা তৈরি করতে আপনি আপনার Google ট্যাগে কাস্টম Google ট্যাগ প্যারামিটার যোগ করতে পারেন।

আপনার নিজস্ব কাস্টম প্যারামিটার তৈরি করার আগে, পূর্বনির্ধারিত পরামিতিগুলির তালিকাটি পরীক্ষা করে দেখুন আপনার ব্যবহারের ক্ষেত্রে ইতিমধ্যেই উপযুক্ত কিনা। পূর্বনির্ধারিত প্যারামিটার ব্যবহার করলে অন্যান্য Google Ads রিমার্কেটিং বৈশিষ্ট্যের সাথে একীভূত করা সহজ হয়।

ব্যবহারকারীর তালিকা তৈরি করুন

এই বিভাগে দুটি ব্যবহারকারীর তালিকার উদাহরণ রয়েছে: একটি পৃষ্ঠার দর্শক যারা অন্য পৃষ্ঠা পরিদর্শন করেছেন এবং একটি পৃষ্ঠার দর্শক যারা অন্য পৃষ্ঠায় যাননি

একটি পৃষ্ঠার দর্শক যারা অন্য পৃষ্ঠা পরিদর্শন করেছেন৷

আপনি একটি flexible_rule_user_list ব্যবহার করে একাধিক পৃষ্ঠা পরিদর্শন করা লোকেদের বিজ্ঞাপন লক্ষ্য করতে পারেন।

প্রথমত, দুটি নিয়ম তৈরি করুন। তারপর, একটি AND অপারেটর ব্যবহার করে flexible_rule_user_list inclusive_operands সাথে নিয়মগুলিকে একত্রিত করুন।

একটি নমনীয় নিয়ম ব্যবহারকারী তালিকা তৈরি করতে কোড উদাহরণ

জাভা

private void runExample(GoogleAdsClient googleAdsClient, long customerId) {
  // Creates a UserListRuleInfo object containing the first rule.
  UserListRuleInfo userVisitedSite1Rule =
      createUserListRuleInfoFromUrl("http://example.com/example1");

  // Creates a UserListRuleInfo object containing the second rule.
  UserListRuleInfo userVisitedSite2Rule =
      createUserListRuleInfoFromUrl("http://example.com/example2");

  // Creates a UserListRuleInfo object containing the third rule.
  UserListRuleInfo userVisitedSite3Rule =
      createUserListRuleInfoFromUrl("http://example.com/example3");

  // Create the user list "Visitors of page 1 AND page 2, but not page 3". To create the user list
  // "Visitors of page 1 *OR* page 2, but not page 3", change the UserListFlexibleRuleOperator
  // from AND to OR.
  FlexibleRuleUserListInfo flexibleRuleUserListInfo =
      FlexibleRuleUserListInfo.newBuilder()
          .setInclusiveRuleOperator(UserListFlexibleRuleOperator.AND)
          // Inclusive operands are joined together with the specified inclusiveRuleOperator. This
          // represents the set of users that should be included in the user list.
          .addInclusiveOperands(
              FlexibleRuleOperandInfo.newBuilder()
                  .setRule(userVisitedSite1Rule)
                  // Optional: adds a lookback window for this rule, in days.
                  .setLookbackWindowDays(7L))
          .addInclusiveOperands(
              FlexibleRuleOperandInfo.newBuilder()
                  .setRule(userVisitedSite2Rule)
                  // Optional: adds a lookback window for this rule, in days.
                  .setLookbackWindowDays(7L))
          .addExclusiveOperands(
              // Exclusive operands are joined together with OR. This represents the set of users
              // to be excluded from the user list.
              FlexibleRuleOperandInfo.newBuilder().setRule(userVisitedSite3Rule))
          .build();

  // Defines a representation of a user list that is generated by a rule.
  RuleBasedUserListInfo ruleBasedUserListInfo =
      RuleBasedUserListInfo.newBuilder()
          // Optional: To include past users in the user list, set the prepopulation_status to
          // REQUESTED.
          .setPrepopulationStatus(UserListPrepopulationStatus.REQUESTED)
          .setFlexibleRuleUserList(flexibleRuleUserListInfo)
          .build();

  // Creates a user list.
  UserList userList =
      UserList.newBuilder()
          .setName("Flexible rule user list for example.com #" + getPrintableDateTime())
          .setDescription(
              "Visitors of both http://example.com/example1 AND http://example.com/example2 but"
                  + " NOT http://example.com/example3")
          .setMembershipStatus(UserListMembershipStatus.OPEN)
          .setRuleBasedUserList(ruleBasedUserListInfo)
          .build();

  // Creates the operation.
  UserListOperation operation = UserListOperation.newBuilder().setCreate(userList).build();

  // Creates the user list service client.
  try (UserListServiceClient userListServiceClient =
      googleAdsClient.getLatestVersion().createUserListServiceClient()) {
    // Adds the user list.
    MutateUserListsResponse response =
        userListServiceClient.mutateUserLists(
            Long.toString(customerId), ImmutableList.of(operation));
    String userListResourceName = response.getResults(0).getResourceName();
    // Prints the result.
    System.out.printf("Created user list with resource name '%s'.%n", userListResourceName);
  }
}

/**
 * Creates a UserListRuleInfo object containing a rule targeting any user that visited the
 * provided URL.
 */
private UserListRuleInfo createUserListRuleInfoFromUrl(String urlString) {
  // Creates a rule targeting any user that visited a URL that equals the given urlString.
  UserListRuleItemInfo userVisitedSiteRule =
      UserListRuleItemInfo.newBuilder()
          // Uses a built-in parameter to create a domain URL rule.
          .setName(URL_STRING)
          .setStringRuleItem(
              UserListStringRuleItemInfo.newBuilder()
                  .setOperator(UserListStringRuleItemOperator.EQUALS)
                  .setValue(urlString))
          .build();

  // Returns a UserListRuleInfo object containing the rule.
  return UserListRuleInfo.newBuilder()
      .addRuleItemGroups(UserListRuleItemGroupInfo.newBuilder().addRuleItems(userVisitedSiteRule))
      .build();
}
      

সি#

public void Run(GoogleAdsClient client, long customerId)
{
    // Creates a UserListRuleInfo object containing the first rule.
    UserListRuleInfo userVisitedSite1Rule =
        CreateUserListRuleInfoFromUrl("http://example.com/example1");

    // Creates a UserListRuleInfo object containing the second rule.
    UserListRuleInfo userVisitedSite2Rule =
        CreateUserListRuleInfoFromUrl("http://example.com/example2");

    // Creates a UserListRuleInfo object containing the third rule.
    UserListRuleInfo userVisitedSite3Rule =
        CreateUserListRuleInfoFromUrl("http://example.com/example3");

    // Create the user list "Visitors of page 1 AND page 2, but not page 3". To create the
    // user list "Visitors of page 1 *OR* page 2, but not page 3", change the
    // UserListFlexibleRuleOperator from And to Or.
    FlexibleRuleUserListInfo flexibleRuleUserListInfo = new FlexibleRuleUserListInfo
    {
        InclusiveRuleOperator = UserListFlexibleRuleOperator.And
    };

    // Inclusive operands are joined together with the specified inclusiveRuleOperator. This
    // represents the set of users that should be included in the user list.
    flexibleRuleUserListInfo.InclusiveOperands.Add(new FlexibleRuleOperandInfo
    {
        Rule = userVisitedSite1Rule,
        // Optional: adds a lookback window for this rule, in days.
        LookbackWindowDays = 7
    });
    flexibleRuleUserListInfo.InclusiveOperands.Add(new FlexibleRuleOperandInfo
    {
        Rule = userVisitedSite2Rule,
        // Optional: adds a lookback window for this rule, in days.
        LookbackWindowDays = 7
    });

    // Exclusive operands are joined together with OR. This represents the set of users
    // to be excluded from the user list.
    flexibleRuleUserListInfo.InclusiveOperands.Add(new FlexibleRuleOperandInfo
    {
        Rule = userVisitedSite3Rule
    });

    // Defines a representation of a user list that is generated by a rule.
    RuleBasedUserListInfo ruleBasedUserListInfo = new RuleBasedUserListInfo
    {
        // Optional: To include past users in the user list, set the prepopulation_status to
        // REQUESTED.
        PrepopulationStatus = UserListPrepopulationStatus.Requested,
        FlexibleRuleUserList = flexibleRuleUserListInfo
    };

    // Creates a user list.
    UserList userList = new UserList
    {
        Name = $"Flexible rule user list example.com #{ExampleUtilities.GetRandomString()}",
        Description = "Visitors of both https://example.com/example1 AND " +
            "https://example.com/example2 but NOT https://example.com/example3",
        MembershipStatus = UserListMembershipStatus.Open,
        RuleBasedUserList = ruleBasedUserListInfo
    };

    // Creates the operation.
    UserListOperation operation = new UserListOperation
    {
        Create = userList
    };

    try
    {
        UserListServiceClient userListServiceClient =
            client.GetService(Services.V16.UserListService);
        MutateUserListsResponse response =
            userListServiceClient.MutateUserLists(customerId.ToString(),
                new[] { operation });

        string userListResourceName = response.Results[0].ResourceName;
        Console.WriteLine($"Created user list with resource name '{userListResourceName}'.");
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}

/// <summary>
/// Creates a UserListRuleInfo object containing a rule targeting any user that visited the
/// provided URL.
/// </summary>
private UserListRuleInfo CreateUserListRuleInfoFromUrl(string urlString)
{
    // Creates a rule targeting any user that visited a URL that equals the given urlString.
    UserListRuleItemInfo userVisitedSiteRule = new UserListRuleItemInfo
    {
        Name = URL_STRING,
        StringRuleItem = new UserListStringRuleItemInfo
        {
            Operator = UserListStringRuleItemOperator.Equals,
            Value = urlString
        }
    };

    // Returns a UserListRuleInfo object containing the rule.
    UserListRuleInfo userListRuleInfo = new UserListRuleInfo();
    UserListRuleItemGroupInfo userListRuleItemGroupInfo = new UserListRuleItemGroupInfo();
    userListRuleItemGroupInfo.RuleItems.Add(userVisitedSiteRule);
    userListRuleInfo.RuleItemGroups.Add(userListRuleItemGroupInfo);

    return userListRuleInfo;
}
      

পিএইচপি

public static function runExample(
    GoogleAdsClient $googleAdsClient,
    int $customerId
) {
    // Creates a rule targeting any user that visited a url that equals
    // http://example.com/example1'.
    $userVisitedSite1RuleInfo = self::createUserListRuleFromUrl('http://example.com/example1');
    // Creates a rule targeting any user that visited a url that equals
    // http://example.com/example2'.
    $userVisitedSite2RuleInfo = self::createUserListRuleFromUrl('http://example.com/example2');
    // Creates a rule targeting any user that visited a url that equals
    // http://example.com/example3'.
    $userVisitedSite3RuleInfo = self::createUserListRuleFromUrl('http://example.com/example3');

    // Create the user list "Visitors of page 1 AND page 2, but not page 3".
    // To create the user list "Visitors of page 1 *OR* page 2, but not page 3",
    // change the UserListFlexibleRuleOperator from PBAND to OR.
    $flexibleRuleUserListInfo = new FlexibleRuleUserListInfo([
        'inclusive_rule_operator' => UserListFlexibleRuleOperator::PBAND,
        'inclusive_operands' => [
            new FlexibleRuleOperandInfo([
                'rule' => $userVisitedSite1RuleInfo,
                // Optionally add a lookback window for this rule, in days.
                'lookback_window_days' => 7
            ]),
            new FlexibleRuleOperandInfo([
                'rule' => $userVisitedSite2RuleInfo,
                // Optionally add a lookback window for this rule, in days.
                'lookback_window_days' => 7
            ])
        ],
        // Exclusive operands are joined together with OR. This represents the set of users to
        // be excluded from the user list.
        'exclusive_operands' => [
            new FlexibleRuleOperandInfo(['rule' => $userVisitedSite3RuleInfo])
        ]
    ]);

    // Defines a representation of a user list that is generated by a rule.
    $ruleBasedUserListInfo = new RuleBasedUserListInfo([
        // Optional: To include past users in the user list, set the prepopulation_status to
        // REQUESTED.
        'prepopulation_status' => UserListPrepopulationStatus::REQUESTED,
        'flexible_rule_user_list' => $flexibleRuleUserListInfo
    ]);

    // Creates a user list.
    $userList = new UserList([
        'name' => 'All visitors to http://example.com/example1 AND ' .
            'http://example.com/example2 but NOT http://example.com/example3 #'
            . Helper::getPrintableDatetime(),
        'description' => 'Visitors of both http://example.com/example1 AND ' .
            'http://example.com/example2 but NOT http://example.com/example3',
        'membership_status' => UserListMembershipStatus::OPEN,
        'rule_based_user_list' => $ruleBasedUserListInfo
    ]);

    // Creates the operation.
    $operation = new UserListOperation();
    $operation->setCreate($userList);

    // Issues a mutate request to add the user list and prints some information.
    $userListServiceClient = $googleAdsClient->getUserListServiceClient();
    $response = $userListServiceClient->mutateUserLists(
        MutateUserListsRequest::build($customerId, [$operation])
    );
    printf(
        "Created user list with resource name '%s'.%s",
        $response->getResults()[0]->getResourceName(),
        PHP_EOL
    );
}
      

পাইথন

def main(client, customer_id):
    """Creates a rule-based user list.

    The list will be defined by a combination of rules for users who have
    visited two different pages of a website.

    Args:
        client: The Google Ads client.
        customer_id: The customer ID for which to add the user list.
    """
    # Create a UserListRuleInfo object containing the first rule.
    user_visited_site1_rule_info = create_user_list_rule_info_from_url(
        client, "http://example.com/example1"
    )
    # Create a UserListRuleInfo object containing the second rule.
    user_visited_site2_rule_info = create_user_list_rule_info_from_url(
        client, "http://example.com/example2"
    )
    # Create a UserListRuleInfo object containing the third rule.
    user_visited_site3_rule_info = create_user_list_rule_info_from_url(
        client, "http://example.com/example3"
    )

    # Create the user list "Visitors of page 1 AND page 2, but not page 3".
    # To create the user list "Visitors of page 1 *OR* page 2, but not page 3",
    # change the UserListFlexibleRuleOperator from AND to OR.
    flexible_rule_user_list_info = client.get_type("FlexibleRuleUserListInfo")
    flexible_rule_user_list_info.inclusive_rule_operator = (
        client.enums.UserListFlexibleRuleOperatorEnum.AND
    )

    # Inclusive operands are joined together with the specified
    # inclusive_rule_operator. This represents the set of users that should be
    # included in the user list.
    operand_1 = client.get_type("FlexibleRuleOperandInfo")
    operand_1.rule = user_visited_site1_rule_info
    # Optionally add a lookback window for this rule, in days.
    operand_1.lookback_window_days = 7
    flexible_rule_user_list_info.inclusive_operands.append(operand_1)

    operand_2 = client.get_type("FlexibleRuleOperandInfo")
    operand_2.rule = user_visited_site2_rule_info
    # Optionally add a lookback window for this rule, in days.
    operand_2.lookback_window_days = 7
    flexible_rule_user_list_info.inclusive_operands.append(operand_2)

    # Exclusive operands are joined together with OR.
    # This represents the set of users to be excluded from the user list.
    operand_3 = client.get_type("FlexibleRuleOperandInfo")
    operand_3.rule = user_visited_site3_rule_info
    flexible_rule_user_list_info.exclusive_operands.append(operand_3)

    # Define a representation of a user list that is generated by a rule.
    rule_based_user_list_info = client.get_type("RuleBasedUserListInfo")
    # Optional: To include past users in the user list, set the
    # prepopulation_status to REQUESTED.
    rule_based_user_list_info.prepopulation_status = (
        client.enums.UserListPrepopulationStatusEnum.REQUESTED
    )
    rule_based_user_list_info.flexible_rule_user_list = (
        flexible_rule_user_list_info
    )

    # Create a user list.
    user_list_operation = client.get_type("UserListOperation")
    user_list = user_list_operation.create
    user_list.name = (
        "All visitors to http://example.com/example1 AND "
        "http://example.com/example2 but NOT "
        f"http://example.com/example3 #{uuid4()}"
    )
    user_list.description = (
        "Visitors of both http://example.com/example1 AND "
        "http://example.com/example2 but NOT"
        "http://example.com/example3"
    )
    user_list.membership_status = client.enums.UserListMembershipStatusEnum.OPEN
    user_list.rule_based_user_list = rule_based_user_list_info

    # Issue a mutate request to add the user list, then print the results.
    user_list_service = client.get_service("UserListService")
    response = user_list_service.mutate_user_lists(
        customer_id=customer_id, operations=[user_list_operation]
    )
    print(
        "Created user list with resource name: "
        f"'{response.results[0].resource_name}.'"
    )
      

রুবি

def add_combined_rule_user_list(customer_id)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new

  user_visited_site1_rule_info = create_user_list_rule_info_from_url(
    client,
    'http://example.com/example1',
  )
  user_visited_site2_rule_info = create_user_list_rule_info_from_url(
    client,
    'http://example.com/example2',
  )
  user_visited_site3_rule_info = create_user_list_rule_info_from_url(
    client,
    'http://example.com/example3',
  )

  # Creates a user list.
  operation = client.operation.create_resource.user_list do |u|
    u.name = "Flexible rule user list for example.com ##{(Time.new.to_f * 1000).to_i}"
    u.description = "Visitors of both http://example.com/example1 AND " \
      "http://example.com/example2 but NOT http://example.com/example3"
    u.membership_status = :OPEN
    # Defines a representation of a user list that is generated by a rule.
    u.rule_based_user_list = client.resource.rule_based_user_list_info do |r|
      # Optional: To include past users in the user list, set the
      # prepopulation_status to REQUESTED.
      r.prepopulation_status = :REQUESTED
      r.flexible_rule_user_list = client.resource.flexible_rule_user_list_info do |frul|
        frul.inclusive_rule_operator = :AND
        frul.inclusive_operands += [
          client.resource.flexible_rule_operand_info do |froi|
            froi.rule = user_visited_site1_rule_info
            # Optionally add a lookback window for this rule, in days.
            froi.lookback_window_days = 7
          end,
          client.resource.flexible_rule_operand_info do |froi|
            froi.rule = user_visited_site2_rule_info
            # Optionally add a lookback window for this rule, in days.
            froi.lookback_window_days = 7
          end,
        ]
        frul.exclusive_operands << client.resource.flexible_rule_operand_info do |froi|
          froi.rule = user_visited_site3_rule_info
        end
      end
    end
  end

  # Issues a mutate request to add the user list and prints some information.
  response = client.service.user_list.mutate_user_lists(
    customer_id: customer_id,
    operations: [operation],
  )

  puts "Created user list with resource name " \
    "#{response.results.first.resource_name}"
end
      

পার্ল

sub add_combined_rule_user_list {
  my ($api_client, $customer_id) = @_;

  # Create a UserListRuleInfo object containing the first rule.
  my $user_visited_site1_rule_info =
    create_user_list_rule_info_from_url("http://example.com/example1");

  # Create a UserListRuleInfo object containing the second rule.
  my $user_visited_site2_rule_info =
    create_user_list_rule_info_from_url("http://example.com/example2");

  # Create a UserListRuleInfo object containing the third rule.
  my $user_visited_site3_rule_info =
    create_user_list_rule_info_from_url("http://example.com/example3");

  # Create the user list "Visitors of page 1 AND page 2, but not page 3".
  # To create the user list "Visitors of page 1 *OR* page 2, but not page 3",
  # change the UserListFlexibleRuleOperator from AND to OR.
  my $flexible_rule_user_list_info =
    Google::Ads::GoogleAds::V16::Common::FlexibleRuleUserListInfo->new({
      inclusiveRuleOperator => AND,
      # Inclusive operands are joined together with the specified inclusiveRuleOperator.
      # This represents the set of users that should be included in the user list.
      inclusiveOperands => [
        Google::Ads::GoogleAds::V16::Common::FlexibleRuleOperandInfo->new({
            rule => $user_visited_site1_rule_info,
            # Optionally add a lookback window for this rule, in days.
            lookbackWindowDays => 7
          }
        ),
        Google::Ads::GoogleAds::V16::Common::FlexibleRuleOperandInfo->new({
            rule => $user_visited_site2_rule_info,
            # Optionally add a lookback window for this rule, in days.
            lookbackWindowDays => 7
          })
      ],
      # Exclusive operands are joined together with OR.
      # This represents the set of users to be excluded from the user list.
      exclusiveOperands => [
        Google::Ads::GoogleAds::V16::Common::FlexibleRuleOperandInfo->new({
            rule => $user_visited_site3_rule_info
          })
      ],
    });

  # Define a representation of a user list that is generated by a rule.
  my $rule_based_user_list_info =
    Google::Ads::GoogleAds::V16::Common::RuleBasedUserListInfo->new({
      # Optional: To include past users in the user list, set the prepopulationStatus
      # to REQUESTED.
      prepopulationStatus  => REQUESTED,
      flexibleRuleUserList => $flexible_rule_user_list_info
    });

  # Create a user list.
  my $user_list = Google::Ads::GoogleAds::V16::Resources::UserList->new({
    name        => "Flexible rule user list for example.com #" . uniqid(),
    description => "Visitors of both http://example.com/example1 AND " .
      "http://example.com/example2 but NOT http://example.com/example3",
    membershipStatus   => OPEN,
    ruleBasedUserList  => $rule_based_user_list_info
  });

  # Create the operation.
  my $user_list_operation =
    Google::Ads::GoogleAds::V16::Services::UserListService::UserListOperation->
    new({
      create => $user_list
    });

  # Issue a mutate request to add the user list and print some information.
  my $user_lists_response = $api_client->UserListService()->mutate({
      customerId => $customer_id,
      operations => [$user_list_operation]});
  printf "Created user list with resource name '%s'.\n",
    $user_lists_response->{results}[0]{resourceName};

  return 1;
}
      

একটি পৃষ্ঠার দর্শক যারা অন্য পৃষ্ঠায় যাননি

আপনি flexible_rule_user_list ব্যবহার করে এমন লোকেদের জন্য বিজ্ঞাপন টার্গেট করতে পারেন যারা একটি পৃষ্ঠা পরিদর্শন করেছে কিন্তু অন্য পৃষ্ঠা নয়। যে দর্শকরা একটি পৃষ্ঠা পরিদর্শন করেছেন তাদের inclusive_operands সেট করা হয়েছে, যখন যে দর্শকরা অন্য পৃষ্ঠায় যাননি তারা exclusive_operands থাকবে। inclusive_rule_operator এ একটি AND দিয়ে দুটি তালিকাকে একত্রিত করুন।

তালিকা পুনরুদ্ধার করুন

আপনার ব্যবহারকারীর তালিকা পুনরুদ্ধার করতে, আপনি user_list রিসোর্সে নিম্নলিখিত Google বিজ্ঞাপন কোয়েরি ভাষার কোয়েরি ইস্যু করতে পারেন।

SELECT
  user_list.name,
  user_list.membership_status,
  user_list.membership_life_span
FROM user_list
WHERE
  user_list.resource_name = 'USER_LIST_RESOURCE_NAME'

তালিকা টার্গেট করুন

আপনার অডিয়েন্স সেগমেন্ট তৈরি করে, পরবর্তী ধাপ হল এটিকে টার্গেট করা।

অডিয়েন্স সেগমেন্ট টার্গেট করার নিয়ম

  1. ইতিবাচক (বিডযোগ্য) ব্যবহারকারী তালিকা একই সময়ে প্রচারাভিযান স্তরে এবং বিজ্ঞাপন গোষ্ঠী স্তরে সেট করা যাবে না। প্রচারাভিযানের জন্য একটি সেট করার আগে একটি প্রচারাভিযানের মধ্যে থাকা সমস্ত বিজ্ঞাপন গোষ্ঠী থেকে ইতিবাচক ব্যবহারকারী তালিকার মানদণ্ড মুছে ফেলতে হবে।

  2. ব্যবহারকারী তালিকা দ্বারা ইতিবাচক টার্গেটিং শুধুমাত্র অনুসন্ধান প্রচারাভিযানের জন্য সমর্থিত। প্রদর্শন প্রচারাভিযানের জন্য, user_list সেট করে এমন CampaignCriterion অবশ্যই বাদ দিতে হবে।

  3. অনুসন্ধান এবং কেনাকাটা প্রচারাভিযানে, ব্যবহারকারীর তালিকা লক্ষ্যগুলি নিম্নলিখিত ক্ষেত্রগুলি সেট করা সমর্থন করে না:

আপনার ব্যবহারকারী তালিকা লক্ষ্য বিজ্ঞাপন

প্রক্রিয়াটি API-তে অন্যান্য ধরনের লক্ষ্য নির্ণয়ের মানদণ্ডের মতো। নিম্নলিখিত কোডটি প্রদর্শন করে যে আপনি কীভাবে একটি বিজ্ঞাপন গোষ্ঠীর বিজ্ঞাপনগুলিকে একটি ব্যবহারকারী তালিকায় লক্ষ্য করতে একটি AdGroupCriterion ব্যবহার করতে পারেন:

জাভা

private String targetAdsInAdGroupToUserList(
    GoogleAdsClient googleAdsClient, long customerId, long adGroupId, String userList) {
  // Creates the ad group criterion targeting members of the user list.
  AdGroupCriterion adGroupCriterion =
      AdGroupCriterion.newBuilder()
          .setAdGroup(ResourceNames.adGroup(customerId, adGroupId))
          .setUserList(UserListInfo.newBuilder().setUserList(userList).build())
          .build();

  // Creates the operation.
  AdGroupCriterionOperation operation =
      AdGroupCriterionOperation.newBuilder().setCreate(adGroupCriterion).build();

  // Creates the ad group criterion service.
  try (AdGroupCriterionServiceClient adGroupCriterionServiceClient =
      googleAdsClient.getLatestVersion().createAdGroupCriterionServiceClient()) {
    // Adds the ad group criterion.
    MutateAdGroupCriteriaResponse response =
        adGroupCriterionServiceClient.mutateAdGroupCriteria(
            Long.toString(customerId), ImmutableList.of(operation));
    // Gets and prints the results.
    String adGroupCriterionResourceName = response.getResults(0).getResourceName();
    System.out.printf(
        "Successfully created ad group criterion with resource name '%s' "
            + "targeting user list with resource name '%s' with ad group with ID %d.%n",
        adGroupCriterionResourceName, userList, adGroupId);
    return adGroupCriterionResourceName;
  }
}
      

সি#

private string TargetAdsInAdGroupToUserList(
    GoogleAdsClient client, long customerId, long adGroupId, string userListResourceName)
{
    // Get the AdGroupCriterionService client.
    AdGroupCriterionServiceClient adGroupCriterionServiceClient = client.GetService
        (Services.V16.AdGroupCriterionService);

    // Create the ad group criterion targeting members of the user list.
    AdGroupCriterion adGroupCriterion = new AdGroupCriterion
    {
        AdGroup = ResourceNames.AdGroup(customerId, adGroupId),
        UserList = new UserListInfo
        {
            UserList = userListResourceName
        }
    };

    // Create the operation.
    AdGroupCriterionOperation adGroupCriterionOperation = new AdGroupCriterionOperation
    {
        Create = adGroupCriterion
    };

    // Add the ad group criterion, then print and return the new criterion's resource name.
    MutateAdGroupCriteriaResponse mutateAdGroupCriteriaResponse =
        adGroupCriterionServiceClient.MutateAdGroupCriteria(customerId.ToString(),
            new[] { adGroupCriterionOperation });

    string adGroupCriterionResourceName =
        mutateAdGroupCriteriaResponse.Results.First().ResourceName;
    Console.WriteLine("Successfully created ad group criterion with resource name " +
        $"'{adGroupCriterionResourceName}' targeting user list with resource name " +
        $"'{userListResourceName}' with ad group with ID {adGroupId}.");
    return adGroupCriterionResourceName;
}
      

পিএইচপি

private static function targetAdsInAdGroupToUserList(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $adGroupId,
    string $userListResourceName
): string {
    // Creates the ad group criterion targeting members of the user list.
    $adGroupCriterion = new AdGroupCriterion([
        'ad_group' => ResourceNames::forAdGroup($customerId, $adGroupId),
        'user_list' => new UserListInfo(['user_list' => $userListResourceName])
    ]);

    // Creates the operation.
    $operation = new AdGroupCriterionOperation();
    $operation->setCreate($adGroupCriterion);

    // Issues a mutate request to add an ad group criterion.
    $adGroupCriterionServiceClient = $googleAdsClient->getAdGroupCriterionServiceClient();
    /** @var MutateAdGroupCriteriaResponse $adGroupCriterionResponse */
    $adGroupCriterionResponse = $adGroupCriterionServiceClient->mutateAdGroupCriteria(
        MutateAdGroupCriteriaRequest::build($customerId, [$operation])
    );

    $adGroupCriterionResourceName =
        $adGroupCriterionResponse->getResults()[0]->getResourceName();
    printf(
        "Successfully created ad group criterion with resource name '%s' " .
        "targeting user list with resource name '%s' with ad group with ID %d.%s",
        $adGroupCriterionResourceName,
        $userListResourceName,
        $adGroupId,
        PHP_EOL
    );

    return $adGroupCriterionResourceName;
}
      

পাইথন

def target_ads_in_ad_group_to_user_list(
    client, customer_id, ad_group_id, user_list_resource_name
):
    """Creates an ad group criterion that targets a user list with an ad group.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a str client customer ID used to create an ad group
            criterion.
        ad_group_id: a str ID for an ad group used to create an ad group
            criterion that targets members of a user list.
        user_list_resource_name: a str resource name for a user list.

    Returns:
        a str resource name for an ad group criterion.
    """
    ad_group_criterion_operation = client.get_type("AdGroupCriterionOperation")
    # Creates the ad group criterion targeting members of the user list.
    ad_group_criterion = ad_group_criterion_operation.create
    ad_group_criterion.ad_group = client.get_service(
        "AdGroupService"
    ).ad_group_path(customer_id, ad_group_id)
    ad_group_criterion.user_list.user_list = user_list_resource_name

    ad_group_criterion_service = client.get_service("AdGroupCriterionService")
    response = ad_group_criterion_service.mutate_ad_group_criteria(
        customer_id=customer_id, operations=[ad_group_criterion_operation]
    )
    resource_name = response.results[0].resource_name
    print(
        "Successfully created ad group criterion with resource name: "
        f"'{resource_name}' targeting user list with resource name: "
        f"'{user_list_resource_name}' and with ad group with ID "
        f"{ad_group_id}."
    )
    return resource_name
      

রুবি

def target_ads_in_ad_group_to_user_list(
  client,
  customer_id,
  ad_group_id,
  user_list
)
  # Creates the ad group criterion targeting members of the user list.
  operation = client.operation.create_resource.ad_group_criterion do |agc|
    agc.ad_group = client.path.ad_group(customer_id, ad_group_id)
    agc.user_list = client.resource.user_list_info do |info|
      info.user_list = user_list
    end
  end

  # Issues a mutate request to create the ad group criterion.
  response = client.service.ad_group_criterion.mutate_ad_group_criteria(
    customer_id: customer_id,
    operations: [operation],
  )
  ad_group_criterion_resource_name = response.results.first.resource_name
  puts "Successfully created ad group criterion with resource name " \
    "'#{ad_group_criterion_resource_name}' targeting user list with resource name " \
    "'#{user_list}' with ad group with ID #{ad_group_id}"

  ad_group_criterion_resource_name
end
      

পার্ল

sub target_ads_in_ad_group_to_user_list {
  my ($api_client, $customer_id, $ad_group_id, $user_list_resource_name) = @_;

  # Create the ad group criterion targeting members of the user list.
  my $ad_group_criterion =
    Google::Ads::GoogleAds::V16::Resources::AdGroupCriterion->new({
      adGroup => Google::Ads::GoogleAds::V16::Utils::ResourceNames::ad_group(
        $customer_id, $ad_group_id
      ),
      userList => Google::Ads::GoogleAds::V16::Common::UserListInfo->new({
          userList => $user_list_resource_name
        })});

  # Create the operation.
  my $ad_group_criterion_operation =
    Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::AdGroupCriterionOperation
    ->new({
      create => $ad_group_criterion
    });

  # Add the ad group criterion, then print and return the new criterion's resource name.
  my $ad_group_criteria_response =
    $api_client->AdGroupCriterionService()->mutate({
      customerId => $customer_id,
      operations => [$ad_group_criterion_operation]});

  my $ad_group_criterion_resource_name =
    $ad_group_criteria_response->{results}[0]{resourceName};
  printf "Successfully created ad group criterion with resource name '%s' " .
    "targeting user list with resource name '%s' with ad group with ID %d.\n",
    $ad_group_criterion_resource_name, $user_list_resource_name, $ad_group_id;

  return $ad_group_criterion_resource_name;
}
      

অন্যান্য ধরনের মানদণ্ডের মতো, আপনি AdGroupCriterion অবজেক্টে অন্যান্য বৈশিষ্ট্য বরাদ্দ করতে পারেন, যেমন বিড ওভাররাইড।

টার্গেটিং লেভেল পরিবর্তন করুন

আপনি যদি বিজ্ঞাপন গোষ্ঠী স্তরের ব্যবহারকারী তালিকার মানদণ্ড থেকে প্রচারাভিযানের স্তরে স্যুইচ করছেন, আপনাকে প্রথমে সেই প্রচারাভিযানের অধীনে প্রতিটি সক্রিয় বা বিরতি দেওয়া বিজ্ঞাপন গোষ্ঠী থেকে বিদ্যমান ব্যবহারকারী তালিকার মানদণ্ডগুলি সরিয়ে ফেলতে হবে৷ প্রতিটি ধাপের উদাহরণ কোড দেখতে প্রসারণযোগ্য উপাদানগুলিতে ক্লিক করুন।

প্রথমে, একটি প্রদত্ত প্রচারাভিযানের অধীনে সমস্ত AdGroupcriteria পুনরুদ্ধার করুন৷

জাভা

private List<String> getUserListAdGroupCriterion(
    GoogleAdsClient googleAdsClient, long customerId, long campaignId) {
  List<String> userListCriteria = new ArrayList<>();
  // Creates the Google Ads service client.
  try (GoogleAdsServiceClient googleAdsServiceClient =
      googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
    // Creates a request that will retrieve all of the ad group criteria under a campaign.
    SearchGoogleAdsRequest request =
        SearchGoogleAdsRequest.newBuilder()
            .setCustomerId(Long.toString(customerId))
            .setPageSize(PAGE_SIZE)
            .setQuery(
                "SELECT ad_group_criterion.criterion_id"
                    + " FROM ad_group_criterion"
                    + " WHERE campaign.id = "
                    + campaignId
                    + " AND ad_group_criterion.type = 'USER_LIST'")
            .build();
    // Issues the search request.
    SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
    // Iterates over all rows in all pages. Prints the results and adds the ad group criteria
    // resource names to the list.
    for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
      String adGroupCriterionResourceName = googleAdsRow.getAdGroupCriterion().getResourceName();
      System.out.printf(
          "Ad group criterion with resource name '%s' was found.%n",
          adGroupCriterionResourceName);
      userListCriteria.add(adGroupCriterionResourceName);
    }
  }
  return userListCriteria;
}
      

সি#

private List<string> GetUserListAdGroupCriteria(
    GoogleAdsClient client, long customerId, long campaignId)
{
    // Get the GoogleAdsService client.
    GoogleAdsServiceClient googleAdsServiceClient =
        client.GetService(Services.V16.GoogleAdsService);

    List<string> userListCriteriaResourceNames = new List<string>();

    // Create a query that will retrieve all of the ad group criteria under a campaign.
    string query = $@"
        SELECT ad_group_criterion.criterion_id
        FROM ad_group_criterion
        WHERE
          campaign.id = {campaignId}
          AND ad_group_criterion.type = 'USER_LIST'";

    // Issue the search request.
    googleAdsServiceClient.SearchStream(customerId.ToString(), query,
        delegate (SearchGoogleAdsStreamResponse resp)
        {
            // Display the results and add the resource names to the list.
            foreach (GoogleAdsRow googleAdsRow in resp.Results)
            {
                string adGroupCriterionResourceName =
                    googleAdsRow.AdGroupCriterion.ResourceName;
                Console.WriteLine("Ad group criterion with resource name " +
                    $"{adGroupCriterionResourceName} was found.");
                userListCriteriaResourceNames.Add(adGroupCriterionResourceName);
            }
        });

    return userListCriteriaResourceNames;
}
      

পিএইচপি

private static function getUserListAdGroupCriteria(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $campaignId
): array {
    // Creates a query that retrieves all of the ad group criteria under a campaign.
    $query = sprintf(
        "SELECT ad_group_criterion.criterion_id " .
        "FROM ad_group_criterion " .
        "WHERE campaign.id = %d " .
        "AND ad_group_criterion.type = 'USER_LIST'",
        $campaignId
    );

    // Creates the Google Ads service client.
    $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();

    // Issues the search request.
    $response = $googleAdsServiceClient->search(
        SearchGoogleAdsRequest::build($customerId, $query)->setPageSize(self::PAGE_SIZE)
    );

    $userListCriteria = [];
    // Iterates over all rows in all pages. Prints the user list criteria and adds the ad group
    // criteria resource names to the list.
    foreach ($response->iterateAllElements() as $googleAdsRow) {
        /** @var GoogleAdsRow $googleAdsRow */
        $adGroupCriterionResourceName = $googleAdsRow->getAdGroupCriterion()->getResourceName();

        printf(
            "Ad group criterion with resource name '%s' was found.%s",
            $adGroupCriterionResourceName,
            PHP_EOL
        );

        $userListCriteria[] = $adGroupCriterionResourceName;
    }

    return $userListCriteria;
}
      

পাইথন

def get_user_list_ad_group_criteria(client, customer_id, campaign_id):
    """Finds all of user list ad group criteria under a campaign.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a str client customer ID.
        campaign_id: a str campaign ID.

    Returns:
        a list of ad group criterion resource names.
    """
    # Creates a query that retrieves all of the ad group criteria under a
    # campaign.
    query = f"""
        SELECT
          ad_group_criterion.criterion_id
        FROM ad_group_criterion
        WHERE campaign.id = {campaign_id}
        AND ad_group_criterion.type = USER_LIST"""

    googleads_service = client.get_service("GoogleAdsService")
    search_request = client.get_type("SearchGoogleAdsRequest")
    search_request.customer_id = customer_id
    search_request.query = query
    search_request.page_size = _DEFAULT_PAGE_SIZE
    response = googleads_service.search(request=search_request)

    # Iterates over all rows in all pages. Prints the user list criteria and
    # adds the ad group criteria resource names to the list.
    user_list_criteria = []
    for row in response:
        resource_name = row.ad_group_criterion.resource_name
        print(
            "Ad group criterion with resource name '{resource_name}' was "
            "found."
        )
        user_list_criteria.append(resource_name)

    return user_list_criteria
      

রুবি

def get_user_list_ad_group_criterion(
  client,
  customer_id,
  campaign_id
)
  user_list_criteria = []

  # Creates a query that will retrieve all of the ad group criteria 
  # under a campaign.
  query = <<~QUERY
    SELECT ad_group_criterion.criterion_id
    FROM ad_group_criterion
    WHERE campaign.id = #{campaign_id}
    AND ad_group_criterion.type = 'USER_LIST'
  QUERY

  # Issues the search request.
  response = client.service.google_ads.search(
    customer_id: customer_id,
    query: query,
    page_size: PAGE_SIZE,
  )

  # Iterates over all rows in all pages. Prints the results and adds the ad
  # group criteria resource names to the list.
  response.each do |row|
    ad_group_criterion_resource_name = row.ad_group_criterion.resource_name
    puts "Ad group criterion with resource name " \
      "'#{ad_group_criterion_resource_name}' was found"
    user_list_criteria << ad_group_criterion_resource_name
  end

  user_list_criteria
end
      

পার্ল

sub get_user_list_ad_group_criteria {
  my ($api_client, $customer_id, $campaign_id) = @_;

  my $user_list_criterion_resource_names = [];

  # Create a search stream request that will retrieve all of the user list ad
  # group criteria under a campaign.
  my $search_stream_request =
    Google::Ads::GoogleAds::V16::Services::GoogleAdsService::SearchGoogleAdsStreamRequest
    ->new({
      customerId => $customer_id,
      query      => sprintf(
        "SELECT ad_group_criterion.criterion_id " .
          "FROM ad_group_criterion " .
          "WHERE campaign.id = %d AND ad_group_criterion.type = 'USER_LIST'",
        $campaign_id
      )});

  my $search_stream_handler =
    Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({
      service => $api_client->GoogleAdsService(),
      request => $search_stream_request
    });

  # Issue a search request and process the stream response.
  $search_stream_handler->process_contents(
    sub {
      # Display the results and add the resource names to the list.
      my $google_ads_row = shift;

      my $ad_group_criterion_resource_name =
        $google_ads_row->{adGroupCriterion}{resourceName};
      printf "Ad group criterion with resource name '%s' was found.\n",
        $ad_group_criterion_resource_name;
      push(@$user_list_criterion_resource_names,
        $ad_group_criterion_resource_name);
    });

  return $user_list_criterion_resource_names;
}
      

তারপরে, বিজ্ঞাপন গোষ্ঠীর মানদণ্ডের সমস্ত টার্গেট মুছে ফেলুন যা ফেরত দেওয়া হয়েছিল।

জাভা

private void removeExistingListCriteriaFromAdGroup(
    GoogleAdsClient googleAdsClient, long customerId, long campaignId) {
  // Retrieves all of the ad group criteria under a campaign.
  List<String> adGroupCriteria =
      getUserListAdGroupCriterion(googleAdsClient, customerId, campaignId);

  List<AdGroupCriterionOperation> operations = new ArrayList<>();

  // Creates a list of remove operations.
  for (String adGroupCriterion : adGroupCriteria) {
    operations.add(AdGroupCriterionOperation.newBuilder().setRemove(adGroupCriterion).build());
  }

  // Creates the ad group criterion service.
  try (AdGroupCriterionServiceClient adGroupCriterionServiceClient =
      googleAdsClient.getLatestVersion().createAdGroupCriterionServiceClient()) {
    // Removes the ad group criterion.
    MutateAdGroupCriteriaResponse response =
        adGroupCriterionServiceClient.mutateAdGroupCriteria(
            Long.toString(customerId), operations);
    // Gets and prints the results.
    System.out.printf("Removed %d ad group criteria.%n", response.getResultsCount());
    for (MutateAdGroupCriterionResult result : response.getResultsList()) {
      System.out.printf(
          "Successfully removed ad group criterion with resource name '%s'.%n",
          result.getResourceName());
    }
  }
}
      

সি#

private void RemoveExistingListCriteriaFromAdGroup(GoogleAdsClient client, long customerId,
    long campaignId)
{
    // Get the AdGroupCriterionService client.
    AdGroupCriterionServiceClient adGroupCriterionServiceClient =
        client.GetService(Services.V16.AdGroupCriterionService);

    // Retrieve all of the ad group criteria under a campaign.
    List<string> adGroupCriteria =
        GetUserListAdGroupCriteria(client, customerId, campaignId);

    // Create a list of remove operations.
    List<AdGroupCriterionOperation> operations = adGroupCriteria.Select(adGroupCriterion =>
        new AdGroupCriterionOperation { Remove = adGroupCriterion }).ToList();

    // Remove the ad group criteria and print the resource names of the removed criteria.
    MutateAdGroupCriteriaResponse mutateAdGroupCriteriaResponse =
        adGroupCriterionServiceClient.MutateAdGroupCriteria(customerId.ToString(),
            operations);

    Console.WriteLine($"Removed {mutateAdGroupCriteriaResponse.Results.Count} ad group " +
        "criteria.");
    foreach (MutateAdGroupCriterionResult result in mutateAdGroupCriteriaResponse.Results)
    {
        Console.WriteLine("Successfully removed ad group criterion with resource name " +
            $"'{result.ResourceName}'.");
    }
}
      

পিএইচপি

private static function removeExistingListCriteriaFromAdGroup(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $campaignId
) {
    // Retrieves all of the ad group criteria under a campaign.
    $allAdGroupCriteria = self::getUserListAdGroupCriteria(
        $googleAdsClient,
        $customerId,
        $campaignId
    );

    $removeOperations = [];
    // Creates a list of remove operations.
    foreach ($allAdGroupCriteria as $adGroupCriterionResourceName) {
        $operation = new AdGroupCriterionOperation();
        $operation->setRemove($adGroupCriterionResourceName);
        $removeOperations[] = $operation;
    }

    // Issues a mutate request to remove the ad group criteria.
    $adGroupCriterionServiceClient = $googleAdsClient->getAdGroupCriterionServiceClient();
    /** @var MutateAdGroupCriteriaResponse $adGroupCriteriaResponse */
    $adGroupCriteriaResponse = $adGroupCriterionServiceClient->mutateAdGroupCriteria(
        MutateAdGroupCriteriaRequest::build($customerId, $removeOperations)
    );

    foreach ($adGroupCriteriaResponse->getResults() as $adGroupCriteriaResult) {
        printf(
            "Successfully removed ad group criterion with resource name '%s'.%s",
            $adGroupCriteriaResult->getResourceName(),
            PHP_EOL
        );
    }
}
      

পাইথন

def remove_existing_criteria_from_ad_group(client, customer_id, campaign_id):
    """Removes all ad group criteria targeting a user list under a campaign.

    This is a necessary step before targeting a user list at the campaign level.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a str client customer ID.
        campaign_id: a str ID for a campaign that will have all ad group
            criteria that targets user lists removed.
    """
    # Retrieves all of the ad group criteria under a campaign.
    all_ad_group_criteria = get_user_list_ad_group_criteria(
        client, customer_id, campaign_id
    )

    # Creates a list of remove operations.
    remove_operations = []
    for ad_group_criterion_resource_name in all_ad_group_criteria:
        remove_operation = client.get_type("AdGroupCriterionOperation")
        remove_operation.remove = ad_group_criterion_resource_name
        remove_operations.append(remove_operation)

    ad_group_criterion_service = client.get_service("AdGroupCriterionService")
    response = ad_group_criterion_service.mutate_ad_group_criteria(
        customer_id=customer_id, operations=remove_operations
    )
    print(
        "Successfully removed ad group criterion with resource name: "
        f"'{response.results[0].resource_name}'"
    )
      

রুবি

def remove_existing_list_criteria_from_ad_group(
  client,
  customer_id,
  campaign_id
)
  # Retrieves all of the ad group criteria under a campaign.
  ad_group_criteria = get_user_list_ad_group_criterion(
    client, customer_id, campaign_id)

  # Creates a list of remove operations.
  operations = []
  ad_group_criteria.each do |agc|
    operations << client.operation.remove_resource.ad_group_criterion(agc)
  end

  # Issues a mutate request to remove all ad group criteria.
  response = client.service.ad_group_criterion.mutate_ad_group_criteria(
    customer_id: customer_id,
    operations: operations,
  )
  puts "Removed #{response.results.size} ad group criteria."
  response.results.each do |result|
    puts "Successfully removed ad group criterion with resource name " \
      "'#{result.resource_name}'"
  end
end
      

পার্ল

sub remove_existing_list_criteria_from_ad_group {
  my ($api_client, $customer_id, $campaign_id) = @_;

  # Retrieve all of the ad group criteria under a campaign.
  my $ad_group_criteria =
    get_user_list_ad_group_criteria($api_client, $customer_id, $campaign_id);

  # Create a list of remove operations.
  my $operations = [];
  foreach my $ad_group_criterion (@$ad_group_criteria) {
    push(
      @$operations,
      Google::Ads::GoogleAds::V16::Services::AdGroupCriterionService::AdGroupCriterionOperation
        ->new({
          remove => $ad_group_criterion
        }));
  }

  # Remove the ad group criteria and print the resource names of the removed criteria.
  my $ad_group_criteria_response =
    $api_client->AdGroupCriterionService()->mutate({
      customerId => $customer_id,
      operations => $operations
    });

  printf "Removed %d ad group criteria.\n",
    scalar @{$ad_group_criteria_response->{results}};
  foreach my $result (@{$ad_group_criteria_response->{results}}) {
    printf "Successfully removed ad group criterion with resource name '%s'.\n",
      $result->{resourceName};
  }
}
      

বিজ্ঞাপন গোষ্ঠী স্তরের ব্যবহারকারীর তালিকায় স্যুইচ করার সময় বিদ্যমান প্রচারাভিযান স্তরের ব্যবহারকারীর তালিকার মানদণ্ডগুলিও মুছে ফেলতে হবে এবং প্রক্রিয়াটি পূর্ববর্তী উদাহরণের প্রতিফলন করে।

একটি প্রচারাভিযানের মাপকাঠি ব্যবহার করে একটি ব্যবহারকারী তালিকায় বিজ্ঞাপনগুলিকে লক্ষ্য করুন৷

জাভা

private String targetAdsInCampaignToUserList(
    GoogleAdsClient googleAdsClient, long customerId, long campaignId, String userList) {
  // Creates the campaign criterion.
  CampaignCriterion campaignCriterion =
      CampaignCriterion.newBuilder()
          .setCampaign(ResourceNames.campaign(customerId, campaignId))
          .setUserList(UserListInfo.newBuilder().setUserList(userList).build())
          .build();

  // Creates the operation.
  CampaignCriterionOperation operation =
      CampaignCriterionOperation.newBuilder().setCreate(campaignCriterion).build();

  // Creates the campaign criterion service client.
  try (CampaignCriterionServiceClient campaignCriterionServiceClient =
      googleAdsClient.getLatestVersion().createCampaignCriterionServiceClient()) {
    // Adds the campaign criterion.
    MutateCampaignCriteriaResponse response =
        campaignCriterionServiceClient.mutateCampaignCriteria(
            Long.toString(customerId), ImmutableList.of(operation));
    // Gets and prints the campaign criterion resource name.
    String campaignCriterionResourceName = response.getResults(0).getResourceName();
    System.out.printf(
        "Successfully created campaign criterion with resource name '%s' "
            + "targeting user list with resource name '%s' with campaign with ID %d.%n",
        campaignCriterionResourceName, userList, campaignId);
    return campaignCriterionResourceName;
  }
}
      

সি#

private string TargetAdsInCampaignToUserList(
    GoogleAdsClient client, long customerId, long campaignId, string userListResourceName)
{
    // Get the CampaignCriterionService client.
    CampaignCriterionServiceClient campaignCriterionServiceClient =
        client.GetService(Services.V16.CampaignCriterionService);

    // Create the campaign criterion.
    CampaignCriterion campaignCriterion = new CampaignCriterion
    {
        Campaign = ResourceNames.Campaign(customerId, campaignId),
        UserList = new UserListInfo
        {
            UserList = userListResourceName
        }
    };

    // Create the operation.
    CampaignCriterionOperation campaignCriterionOperation = new CampaignCriterionOperation
    {
        Create = campaignCriterion
    };

    // Add the campaign criterion and print the resulting criterion's resource name.
    MutateCampaignCriteriaResponse mutateCampaignCriteriaResponse =
        campaignCriterionServiceClient.MutateCampaignCriteria(customerId.ToString(),
            new[] { campaignCriterionOperation });

    string campaignCriterionResourceName =
        mutateCampaignCriteriaResponse.Results.First().ResourceName;
    Console.WriteLine("Successfully created campaign criterion with resource name " +
        $"'{campaignCriterionResourceName}' targeting user list with resource name " +
        $"'{userListResourceName}' with campaign with ID {campaignId}.");

    return campaignCriterionResourceName;
}
      

পিএইচপি

private static function targetAdsInCampaignToUserList(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $campaignId,
    string $userListResourceName
): string {
    // Creates the campaign criterion.
    $campaignCriterion = new CampaignCriterion([
        'campaign' => ResourceNames::forCampaign($customerId, $campaignId),
        'user_list' => new UserListInfo(['user_list' => $userListResourceName])
    ]);

    // Creates the operation.
    $operation = new CampaignCriterionOperation();
    $operation->setCreate($campaignCriterion);

    // Issues a mutate request to create a campaign criterion.
    $campaignCriterionServiceClient = $googleAdsClient->getCampaignCriterionServiceClient();
    /** @var MutateCampaignCriteriaResponse $campaignCriteriaResponse */
    $campaignCriteriaResponse = $campaignCriterionServiceClient->mutateCampaignCriteria(
        MutateCampaignCriteriaRequest::build($customerId, [$operation])
    );

    $campaignCriterionResourceName =
        $campaignCriteriaResponse->getResults()[0]->getResourceName();
    printf(
        "Successfully created campaign criterion with resource name '%s' " .
        "targeting user list with resource name '%s' with campaign with ID %d.%s",
        $campaignCriterionResourceName,
        $userListResourceName,
        $campaignId,
        PHP_EOL
    );

    return $campaignCriterionResourceName;
}
      

পাইথন

def target_ads_in_campaign_to_user_list(
    client, customer_id, campaign_id, user_list_resource_name
):
    """Creates a campaign criterion that targets a user list with a campaign.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a str client customer ID used to create an campaign
            criterion.
        campaign_id: a str ID for a campaign used to create a campaign
            criterion that targets members of a user list.
        user_list_resource_name: a str resource name for a user list.

    Returns:
        a str resource name for a campaign criterion.
    """
    campaign_criterion_operation = client.get_type("CampaignCriterionOperation")
    campaign_criterion = campaign_criterion_operation.create
    campaign_criterion.campaign = client.get_service(
        "CampaignService"
    ).campaign_path(customer_id, campaign_id)
    campaign_criterion.user_list.user_list = user_list_resource_name

    campaign_criterion_service = client.get_service("CampaignCriterionService")
    response = campaign_criterion_service.mutate_campaign_criteria(
        customer_id=customer_id, operations=[campaign_criterion_operation]
    )
    resource_name = response.results[0].resource_name
    print(
        "Successfully created campaign criterion with resource name "
        f"'{resource_name}' targeting user list with resource name "
        f"'{user_list_resource_name}' with campaign with ID {campaign_id}"
    )
    return resource_name
      

রুবি

def target_ads_in_campaign_to_user_list(
  client,
  customer_id,
  campaign_id,
  user_list
)
  # Creates the campaign criterion targeting members of the user list.
  operation = client.operation.create_resource.campaign_criterion do |cc|
    cc.campaign = client.path.campaign(customer_id, campaign_id)
    cc.user_list = client.resource.user_list_info do |info|
      info.user_list = user_list
    end
  end

  # Issues a mutate request to create the campaign criterion.
  response = client.service.campaign_criterion.mutate_campaign_criteria(
    customer_id: customer_id,
    operations: [operation],
  )
  campaign_criterion_resource_name = response.results.first.resource_name
  puts "Successfully created campaign criterion with resource name " \
    "'#{campaign_criterion_resource_name}' targeting user list with resource name " \
    "'#{user_list}' with campaign with ID #{campaign_id}"

  campaign_criterion_resource_name
end
      

পার্ল

sub target_ads_in_campaign_to_user_list {
  my ($api_client, $customer_id, $campaign_id, $user_list_resource_name) = @_;

  # Create the campaign criterion.
  my $campaign_criterion =
    Google::Ads::GoogleAds::V16::Resources::CampaignCriterion->new({
      campaign => Google::Ads::GoogleAds::V16::Utils::ResourceNames::campaign(
        $customer_id, $campaign_id
      ),
      userList => Google::Ads::GoogleAds::V16::Common::UserListInfo->new({
          userList => $user_list_resource_name
        })});

  # Create the operation.
  my $campaign_criterion_operation =
    Google::Ads::GoogleAds::V16::Services::CampaignCriterionService::CampaignCriterionOperation
    ->new({
      create => $campaign_criterion
    });

  # Add the campaign criterion and print the resulting criterion's resource name.
  my $campaign_criteria_response =
    $api_client->CampaignCriterionService()->mutate({
      customerId => $customer_id,
      operations => [$campaign_criterion_operation]});

  my $campaign_criterion_resource_name =
    $campaign_criteria_response->{results}[0]{resourceName};
  printf "Successfully created campaign criterion with resource name '%s' " .
    "targeting user list with resource name '%s' with campaign with ID %d.\n",
    $campaign_criterion_resource_name, $user_list_resource_name, $campaign_id;

  return $campaign_criterion_resource_name;
}
      

তালিকা কর্মক্ষমতা পর্যালোচনা

আপনার শ্রোতা অংশগুলির জন্য পারফরম্যান্স ডেটা সংগ্রহ করার জন্য, ad_group_audience_view বা campaign_audience_view সংস্থানের বিরুদ্ধে একটি অনুসন্ধানের অনুরোধ জারি করুন৷ উদাহরণ স্বরূপ, দর্শকের অংশকে টার্গেট করা আসলে আরও বেশি রূপান্তর ঘটাচ্ছে কিনা তা নির্ধারণ করতে আপনি conversions বা cost_per_conversion দেখতে পারেন, তারপর সেই অনুযায়ী আপনার বিড মডিফায়ারগুলিকে সামঞ্জস্য করুন।

SELECT
  ad_group_criterion.criterion_id,
  metrics.conversions,
  metrics.cost_per_conversion
FROM ad_group_audience_view