डेटा एक्सक्लूज़न बनाएं

डेटा एक्सक्लूज़न एक ऐडवांस टूल है. इसका इस्तेमाल करके स्मार्ट बिडिंग की रणनीति में, उन तारीखों के सभी डेटा को अनदेखा किया जा सकता है जो खाते की कन्वर्ज़न ट्रैकिंग में समस्याएं थीं. डेटा एक्सक्लूज़न के काम करने के तरीके के बारे में ज़्यादा जानने के लिए, डेटा एक्सक्लूज़न का सहायता पेज देखें.

BiddingDataExclusions का इस्तेमाल करके, प्रोग्राम के हिसाब से डेटा एक्सक्लूज़न बनाएं.

स्कोप

BiddingDataExclusions में ज़रूरीscope वैल्यू होती है, जिसे यहां दी गई वैल्यू पर सेट किया जा सकता है. स्कोप के हिसाब से तय किए गए अतिरिक्त कॉन्फ़िगरेशन विकल्प, स्कोप के इस्तेमाल के हिसाब से सेट किए जाते हैं.

  • CAMPAIGN - एक्सक्लूज़न को खास कैंपेन पर लागू किया जाता है. campaigns फ़ील्ड को कैंपेन रिसॉर्स के उन नामों की सूची पर सेट करें जिन पर यह एक्सक्लूज़न लागू होगा.
    • हर BiddingDataExclusion कैंपेन की ज़्यादा से ज़्यादा संख्या 2,000 है.
  • CHANNEL - यह पाबंदी उन कैंपेन पर लागू होती है जो किसी खास तरह के चैनल से जुड़े हैं. advertising_channel_types फ़ील्ड को AdvertisingChannelTypes की सूची में सेट करें, जिस पर यह एक्सक्लूज़न लागू होगा.

डिवाइस

डेटा एक्सक्लूज़न के स्कोप के अलावा, डेटा एक्सक्लूज़न को उन डिवाइस टाइप की वैकल्पिक सूची के साथ भी कॉन्फ़िगर किया जा सकता है जिन पर एक्सक्लूज़न लागू होगा. अगर devices को सेट किया गया है, तो सिर्फ़ बताए गए डिवाइस टाइप का कन्वर्ज़न डेटा बाहर रखा जाएगा. अगर इसके बारे में नहीं बताया गया है, तो सभी तरह के डिवाइस का कन्वर्ज़न डेटा शामिल नहीं किया जाएगा.

तारीख और समय

स्कोप और वैकल्पिक डिवाइसों के अलावा, हर डेटा एक्सक्लूज़न में शुरू और खत्म होने की तारीख और समय होना चाहिए. डेटा एक्सक्लूज़न से जुड़े पुराने डेटा पर विचार किया जा सकता है. इसका इस्तेमाल उन इवेंट के लिए किया जाना चाहिए जिनमें पहले start_date_time मौजूद हो और जिनका इस्तेमाल पहले या आने वाले समय में end_date_time किया गया हो. समय, खाते के टाइमज़ोन के मुताबिक हैं.

उदाहरण

नीचे दिए गए उदाहरण में, CHANNEL स्कोप की मदद से डेटा एक्सक्लूज़न बनाने का तरीका बताया गया है. टिप्पणी किए गए सेक्शन से पता चलता है कि अगर CAMPAIGN स्कोप के बजाय, आपको कैंपेन सेट करने थे, तो कैंपेन कैसे तय किए जाएं.

Java

BiddingDataExclusion DataExclusion =
    BiddingDataExclusion.newBuilder()
        // A unique name is required for every data exclusion.
        .setName("Data exclusion #" + getPrintableDateTime())
        // The CHANNEL scope applies the data exclusion to all campaigns of specific
        // advertising channel types. In this example, the exclusion will only apply to
        // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
        // campaigns.
        .setScope(SeasonalityEventScope.CHANNEL)
        .addAdvertisingChannelTypes(AdvertisingChannelType.SEARCH)
        // If setting scope CAMPAIGN, add individual campaign resource name(s) according to
        // the commented out line below.
        // .addCampaigns("INSERT_CAMPAIGN_RESOURCE_NAME_HERE")
        .setStartDateTime(startDateTime)
        .setEndDateTime(endDateTime)
        .build();

BiddingDataExclusionOperation operation =
    BiddingDataExclusionOperation.newBuilder().setCreate(DataExclusion).build();

MutateBiddingDataExclusionsResponse response =
    DataExclusionServiceClient.mutateBiddingDataExclusions(
        customerId.toString(), ImmutableList.of(operation));
System.out.printf(
    "Added data exclusion with resource name: %s%n",
    response.getResults(0).getResourceName());
      

C#

BiddingDataExclusion dataExclusion = new BiddingDataExclusion()
{
    // A unique name is required for every data exclusion.
    Name = "Data exclusion #" + ExampleUtilities.GetRandomString(),
    // The CHANNEL scope applies the data exclusion to all campaigns of specific
    // advertising channel types. In this example, the the exclusion will only apply to
    // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
    // campaigns.
    Scope = SeasonalityEventScope.Channel,
    AdvertisingChannelTypes = { AdvertisingChannelType.Search },
    // The date range should be less than 14 days.
    StartDateTime = startDateTime,
    EndDateTime = endDateTime,
};
BiddingDataExclusionOperation operation = new BiddingDataExclusionOperation()
{
    Create = dataExclusion
};

try
{
    MutateBiddingDataExclusionsResponse response =
        biddingDataExclusionService.MutateBiddingDataExclusions(
            customerId.ToString(), new[] { operation });
    Console.WriteLine($"Added data exclusion with resource name: " +
        $"{response.Results[0].ResourceName}");
}
catch (GoogleAdsException e)
{
    Console.WriteLine("Failure:");
    Console.WriteLine($"Message: {e.Message}");
    Console.WriteLine($"Failure: {e.Failure}");
    Console.WriteLine($"Request ID: {e.RequestId}");
    throw;
}
      

PHP

// Creates a bidding data exclusion.
$dataExclusion = new BiddingDataExclusion([
    // A unique name is required for every data exclusion.
    'name' => 'Data exclusion #' . Helper::getPrintableDatetime(),
    // The CHANNEL scope applies the data exclusion to all campaigns of specific
    // advertising channel types. In this example, the exclusion will only apply to
    // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
    // campaigns.
    'scope' => SeasonalityEventScope::CHANNEL,
    'advertising_channel_types' => [AdvertisingChannelType::SEARCH],
    // If setting scope CAMPAIGN, add individual campaign resource name(s) according to
    // the commented out line below.
    // 'campaigns' => ['INSERT_CAMPAIGN_RESOURCE_NAME_HERE'],
    'start_date_time' => $startDateTime,
    'end_date_time' => $endDateTime
]);

// Creates a bidding data exclusion operation.
$biddingDataExclusionOperation = new BiddingDataExclusionOperation();
$biddingDataExclusionOperation->setCreate($dataExclusion);

// Submits the bidding data exclusion operation to add the bidding data exclusion.
$biddingDataExclusionServiceClient =
    $googleAdsClient->getBiddingDataExclusionServiceClient();
$response = $biddingDataExclusionServiceClient->mutateBiddingDataExclusions(
    MutateBiddingDataExclusionsRequest::build($customerId, [$biddingDataExclusionOperation])
);

printf(
    "Added bidding data exclusion with resource name: '%s'.%s",
    $response->getResults()[0]->getResourceName(),
    PHP_EOL
);
      

Python

bidding_data_exclusion_service = client.get_service(
    "BiddingDataExclusionService"
)
operation = client.get_type("BiddingDataExclusionOperation")
bidding_data_exclusion = operation.create
# A unique name is required for every data exclusion
bidding_data_exclusion.name = f"Data exclusion #{uuid4()}"
# The CHANNEL scope applies the data exclusion to all campaigns of specific
# advertising channel types. In this example, the exclusion will only
# apply to Search campaigns. Use the CAMPAIGN scope to instead limit the
# scope to specific campaigns.
bidding_data_exclusion.scope = (
    client.enums.SeasonalityEventScopeEnum.CHANNEL
)
bidding_data_exclusion.advertising_channel_types.append(
    client.enums.AdvertisingChannelTypeEnum.SEARCH
)
# If setting scope CAMPAIGN, add individual campaign resource name(s)
# according to the commented out line below.
#
# bidding_data_exclusion.campaigns.append(
#     "INSERT_CAMPAIGN_RESOURCE_NAME_HERE"
# )

bidding_data_exclusion.start_date_time = start_date_time
bidding_data_exclusion.end_date_time = end_date_time

response = bidding_data_exclusion_service.mutate_bidding_data_exclusions(
    customer_id=customer_id, operations=[operation]
)

resource_name = response.results[0].resource_name

print(f"Added data exclusion with resource name: '{resource_name}'")
      

Ruby

client = Google::Ads::GoogleAds::GoogleAdsClient.new

operation = client.operation.create_resource.bidding_data_exclusion do |bda|
  # A unique name is required for every data excluseion.
  bda.name = "Seasonality Adjustment #{(Time.new.to_f * 1000).to_i}"

  # The CHANNEL scope applies the data exclusion to all campaigns of specific
  # advertising channel types. In this example, the conversion_rate_modifier
  # will only apply to Search campaigns. Use the CAMPAIGN scope to instead
  # limit the scope to specific campaigns.
  bda.scope = :CHANNEL
  bda.advertising_channel_types << :SEARCH

  # If setting scope CAMPAIGN, add individual campaign resource name(s)
  # according to the commented out line below.
  #
  # bda.campaigns << "INSERT_CAMPAIGN_RESOURCE_NAME_HERE"

  bda.start_date_time = start_date_time
  bda.end_date_time = end_date_time
end

response = client.service.bidding_data_exclusion.mutate_bidding_data_exclusions(
  customer_id: customer_id,
  operations: [operation],
)

puts "Added data exclusion with resource name #{response.results.first.resource_name}."
      

Perl

my $data_exclusion =
  Google::Ads::GoogleAds::V16::Resources::BiddingDataExclusion->new({
    # A unique name is required for every data exclusion.
    name => "Data exclusion #" . uniqid(),
    # The CHANNEL scope applies the data exclusion to all campaigns of specific
    # advertising channel types. In this example, the exclusion will only apply
    # to Search campaigns. Use the CAMPAIGN scope to instead limit the scope to
    # specific campaigns.
    scope                   => CHANNEL,
    advertisingChannelTypes => [SEARCH],
    # If setting scope CAMPAIGN, add individual campaign resource name(s)
    # according to the commented out line below.
    # campaigns     => ["INSERT_CAMPAIGN_RESOURCE_NAME_HERE"],
    startDateTime => $start_date_time,
    endDateTime   => $end_date_time
  });

my $operation =
  Google::Ads::GoogleAds::V16::Services::BiddingDataExclusionService::BiddingDataExclusionOperation
  ->new({
    create => $data_exclusion
  });

my $response = $api_client->BiddingDataExclusionService()->mutate({
    customerId => $customer_id,
    operations => [$operation]});

printf "Added data exclusion with resource name: '%s'.\n",
  $response->{results}[0]{resourceName};